gnu: librsvg-next: Substitute more crates.
[jackhill/guix/guix.git] / gnu / packages / selinux.scm
index 99f9e76..1c45cb8 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,7 @@
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages xml))
        (modify-phases %standard-phases
          (delete 'configure)
          (add-after 'unpack 'enter-dir
-           (lambda _ (chdir ,name) #t)))))
+           (lambda _ (chdir ,name) #t))
+         (add-after 'enter-dir 'portability
+           (lambda _
+             (substitute* "src/ibpkeys.c"
+               (("#include \"ibpkey_internal.h\"" line)
+                (string-append line "\n#include <inttypes.h>\n"))
+               (("%#lx") "%#\" PRIx64 \""))
+             #t)))))
     (native-inputs
      `(("flex" ,flex)))
     (home-page "https://selinuxproject.org/")
@@ -101,6 +110,7 @@ boolean settings).")
        #:phases
        (modify-phases %standard-phases
          (delete 'configure)
+         (delete 'portability)
          (add-after 'unpack 'enter-dir
            (lambda _ (chdir ,name) #t)))))
     (inputs
@@ -121,6 +131,7 @@ module into a binary representation.")
 (define-public libselinux
   (package (inherit libsepol)
     (name "libselinux")
+    (outputs '("out" "python"))
     (arguments
      (substitute-keyword-arguments (package-arguments libsepol)
        ((#:make-flags flags)
@@ -129,13 +140,14 @@ module into a binary representation.")
                               (assoc-ref %build-inputs "libsepol")
                               "/lib/libsepol.a")
                 (string-append "PYSITEDIR="
-                               (assoc-ref %outputs "out")
+                               (assoc-ref %outputs "python")
                                "/lib/python"
                                ,(version-major+minor (package-version python))
                                "/site-packages/")
                 ,flags))
        ((#:phases phases)
         `(modify-phases ,phases
+           (delete 'portability)
            (replace 'enter-dir
              (lambda _ (chdir ,name) #t))
            (add-after 'enter-dir 'remove-Werror
@@ -148,10 +160,10 @@ module into a binary representation.")
                #t))
            (add-after 'build 'pywrap
              (lambda* (#:key make-flags #:allow-other-keys)
-               (zero? (apply system* "make" "pywrap" make-flags))))
+               (apply invoke "make" "pywrap" make-flags)))
            (add-after 'install 'install-pywrap
              (lambda* (#:key make-flags #:allow-other-keys)
-               (zero? (apply system* "make" "install-pywrap" make-flags))))))))
+               (apply invoke "make" "install-pywrap" make-flags)))))))
     ;; These libraries are in "Requires.private" in libselinux.pc.
     (propagated-inputs
      `(("libsepol" ,libsepol)
@@ -187,14 +199,15 @@ the core SELinux management utilities.")
                 ,flags))
        ((#:phases phases)
         `(modify-phases ,phases
+           (delete 'portability)
            (replace 'enter-dir
              (lambda _ (chdir ,name) #t))
            (add-after 'build 'pywrap
              (lambda* (#:key make-flags #:allow-other-keys)
-               (zero? (apply system* "make" "pywrap" make-flags))))
+               (apply invoke "make" "pywrap" make-flags)))
            (add-after 'install 'install-pywrap
              (lambda* (#:key make-flags #:allow-other-keys)
-               (zero? (apply system* "make" "install-pywrap" make-flags))))))))
+               (apply invoke "make" "install-pywrap" make-flags)))))))
     (inputs
      `(("libsepol" ,libsepol)
        ("libselinux" ,libselinux)
@@ -228,6 +241,7 @@ binary policies.")
                  ,flags)))
        ((#:phases phases)
         `(modify-phases ,phases
+           (delete 'portability)
            (replace 'enter-dir
              (lambda _ (chdir ,name) #t))))))
     (inputs
@@ -250,6 +264,7 @@ binary policies.")
        ,@(substitute-keyword-arguments (package-arguments libsepol)
            ((#:phases phases)
             `(modify-phases ,phases
+               (delete 'portability)
                (replace 'enter-dir
                  (lambda _ (chdir "python/sepolgen") #t))
                ;; By default all Python files would be installed to
@@ -310,6 +325,7 @@ based on required access.")
      `(#:tests? #f ; the test target causes a rebuild
        #:phases
        (modify-phases %standard-phases
+         (delete 'portability)
          (add-after 'unpack 'set-SEPOL-variable
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "SEPOL"
@@ -372,6 +388,7 @@ tools, and libraries designed to facilitate SELinux policy analysis.")
        #:phases
        (modify-phases %standard-phases
          (delete 'configure)
+         (delete 'portability)
          (add-after 'unpack 'enter-dir
            (lambda _ (chdir ,name) #t))
          (add-after 'enter-dir 'ignore-/usr-tests