;;; Copyright © 2022 Denis Carikli ;;; ;;; 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. ;;; If not, see . ;;; ;;; This file is meant to test valgrind support in Guix. ;;; ;;; The libsamsung-ipc library is not ready to be packaged in general ;;; purpose distributions as right now as it requires either a vendor ;;; kernel or the compbinaison of a recent upstream kernel with on top ;;; work in progress out of tree modem drivers, out of tree ;;; libsamsung-ipc code to support theses drivers and kernel patches ;;; to support the nonfree bootloader of the Galaxy SIII ;;; (GT-I9300). Beside the library, the tools are of very limited use ;;; beside testing or reverse engineering. (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 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") ;; we use a work in progress version that has support for --with-valgrind-tests (version (git-version "0.0" "HEAD" "92de58c3ecd3f6a40323161dd28f2c9ad075ca62")) (source (origin (method git-fetch) (uri (git-reference (url "https://git.replicant.us/replicant-next/hardware_replicant_libsamsung-ipc") (commit "92de58c3ecd3f6a40323161dd28f2c9ad075ca62"))) (sha256 (base32 "0glm8hvb46iq1dhhbhymckxi6lcxn5k30lywcppbs7s8r4bnkwvy")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (native-inputs (list autoconf automake curl ddrescue libtool pkg-config python python-sh valgrind/interactive)) (inputs (list openssl)) (arguments `(#:phases (modify-phases %standard-phases (add-before 'build 'patch-python (lambda _ (substitute* (find-files "." ".*\\.py$") (("/usr/bin/env python") (which "python3"))) #t))) #:tests? #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)