summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-02-06 19:21:04 +0000
committerRick van Schijndel <Mindavi@users.noreply.github.com>2023-02-07 07:18:56 +0100
commitfa0633e7faac4be522850c55854683db71ef6d8f (patch)
tree6d7a138c48a136ad1e9a906c67e3e703e9cf7922
parent99cce0e1f1ccb6eab8d92e8ebe9be7c3be3b3ed1 (diff)
downloadnixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar.gz
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar.bz2
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar.lz
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar.xz
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.tar.zst
nixpkgs-fa0633e7faac4be522850c55854683db71ef6d8f.zip
libvisual: pull upstream fix for pkg-config SDL1 discovery
Without the change cross-compilation fails in `staging-next` as:

    $ nix build --no-link -f. pkgsCross.riscv64.libvisual
    ...
    > checking for riscv64-unknown-linux-gnu-sdl-config... no
    > checking for sdl-config... no

While at it added `strictDeps = true;`.
-rw-r--r--pkgs/development/libraries/libvisual/default.nix28
1 files changed, 27 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libvisual/default.nix b/pkgs/development/libraries/libvisual/default.nix
index f32ee433694..ea62117951e 100644
--- a/pkgs/development/libraries/libvisual/default.nix
+++ b/pkgs/development/libraries/libvisual/default.nix
@@ -1,7 +1,9 @@
 { lib
 , stdenv
 , fetchurl
+, fetchpatch
 , SDL
+, autoreconfHook
 , glib
 , pkg-config
 }:
@@ -15,12 +17,36 @@ stdenv.mkDerivation rec {
     hash = "sha256-qhKHdBf3bTZC2fTHIzAjgNgzF1Y51jpVZB0Bkopd230=";
   };
 
-  nativeBuildInputs = [ pkg-config ];
+  patches = [
+    # pull upstream fix for SDL1 cross-compilation.
+    #   https://github.com/Libvisual/libvisual/pull/238
+    (fetchpatch {
+      name = "sdl-cross-prereq.patch";
+      url = "https://github.com/Libvisual/libvisual/commit/7902d24aa1a552619a5738339b3823e90dd3b865.patch";
+      hash = "sha256-84u8klHDAw/q4d+9L4ROAr7XsbXItHrhaEKkTEMSPcc=";
+      # remove extra libvisual prefix
+      stripLen = 1;
+      # pull in only useful configure.ac changes.
+      excludes = [ "Makefile.am" ];
+    })
+    (fetchpatch {
+      name = "sdl-cross-pc.patch";
+      url = "https://github.com/Libvisual/libvisual/commit/f79a2e8d21ad1d7fe26e2aa83cea4c9f48f9e392.patch";
+      hash = "sha256-8c7SdLxXC8K9BAwj7DzozsZAcbs5l1xuBqky9LJ1MfM=";
+      # remove extra libvisual prefix
+      stripLen = 1;
+    })
+  ];
+
+  strictDeps = true;
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ SDL glib ];
 
   configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
+    # Remove once "sdl-cross-prereq.patch" patch above is removed.
+    "--disable-lv-tool"
   ];
 
   meta = {