aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/libsamsung-ipc.scm
blob: 06e488c23973100d88f31ddaa7d65bdb23aff342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
;;; Copyright © 2022 Denis Carikli <GNUtoo@cyberdimension.org>
;;;
;;; This file is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This file is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
;;; The guix.scm file is a convention: A file named guix.scm is
;;; found in several project source code, either in the top
;;; directory or in sub-directories like contrib for instance.

(use-modules
 (ice-9 popen)
 (ice-9 rdelim)
 (sxml ssax input-parse)
 ((guix licenses) #:prefix license:)
 (guix build-system android-ndk)
 (guix build-system gnu)
 (guix gexp)
 (guix git-download)
 (guix packages)
 (gnu packages android)
 (gnu packages autotools)
 (gnu packages commencement)
 (gnu packages curl)
 (gnu packages disk)
 (gnu packages linux)
 (gnu packages llvm)
 (gnu packages pkg-config)
 (gnu packages python)
 (gnu packages python-xyz)
 (gnu packages tls)
 (gnu packages valgrind))

(define-public libsamsung-ipc
  (package
    (name "libsamsung-ipc")
    (version (git-version "0.0" "HEAD" "1ae84b407cc187dabf4641924dab85969ffe9fb8"))
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://git.replicant.us/replicant-next/hardware_replicant_libsamsung-ipc")
         (commit "1ae84b407cc187dabf4641924dab85969ffe9fb8")))
       (sha256
        (base32 "1hp27kziincsy03lc0pna6rlk13zq44hjkjr2hrg5v2k9cywas3z"))
       (file-name (git-file-name name version))))
    (build-system gnu-build-system)
    (native-inputs
     `(("autoreconf" ,autoconf)
       ("aclocal" ,automake)
       ("libcurl" ,curl)
       ("ddrescue", ddrescue)
       ("libc:debug", (@@ (gnu packages commencement) glibc-final) "debug")
       ("libtool" ,libtool)
       ("pkgconfig" ,pkg-config)
       ("python" ,python)
       ("python-sh" ,python-sh)
       ("valgrind" ,valgrind)))
    (inputs
     `(("openssl" ,openssl)))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'build 'patch-python
           (lambda _
             (substitute* (find-files "." ".*\\.py$")
               (("/usr/bin/env python") (which "python3")))
           #t))
         ;; (add-after 'patch-python 'fix-valgrind
         ;;   (lambda _
         ;;     (substitute* (find-files "." ".*\\.py$")
         ;;                  (("'--leak-check=full',")
         ;;                   (string-append
         ;;                    "'--leak-check=full', '--extra-debuginfo-path="
         ;;                    (assoc-ref %build-inputs "libc:debug")
         ;;                    "/lib/debug',")))
         ;;     #t))
	 )
       #:configure-flags
       (list "--enable-debug"
             "--enable-valgrind-tests")))
    (synopsis "libsamsung-ipc is a free software implementation of the Samsung IPC modem protocol")
    (description
     "libsamsung-ipc is a free software implementation of the Samsung IPC modem protocol,
found in many Samsung smartphones and tablets.")
    (home-page "https://www.replicant.us")
    (license license:gpl2+)))

(list libsamsung-ipc)