about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2024-06-16 08:38:14 +0000
committerGitHub <noreply@github.com>2024-06-16 08:38:14 +0000
commitac4054068ec3fa7a14a4824a844a0c5928546849 (patch)
tree3aa59692c2b164f07cacdc01c73b50d16e388b36 /pkgs/development/libraries
parent5fa29cc3ee51f21c8561c627a125c2bd82e006bc (diff)
parentc4681a43e64ef2eff3baad710a26b061165eb94b (diff)
Merge pull request #314507 from ShamrockLee/libdvdnav_4_2_1-cross
libdvdnav_4_2_1: fix cross-compilation
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/libdvdnav/4.2.1.nix21
1 files changed, 20 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libdvdnav/4.2.1.nix b/pkgs/development/libraries/libdvdnav/4.2.1.nix
index 5ee1d423fd3ff..852ab2ea73099 100644
--- a/pkgs/development/libraries/libdvdnav/4.2.1.nix
+++ b/pkgs/development/libraries/libdvdnav/4.2.1.nix
@@ -12,12 +12,31 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [libdvdread];
 
-  configureScript = "./configure2"; # wtf?
+  # The upstream supports two configuration workflow:
+  # one is to generate ./configure via `autoconf`,
+  # the other is to run ./configure2.
+  # ./configure2 is a configureation script included in the upstream source
+  # that supports common "--<name>" flags and generates config.mak and config.h.
+  # See INSTALL inside the upstream source for detail.
+  configureScript = "./configure2";
+
+  configureFlags = [
+    "--cc=${stdenv.cc.targetPrefix}cc"
+    # Let's strip the binaries ourselves,
+    # as unprefixed `strip` command is not available during cross compilation.
+    "--disable-strip"
+  ];
 
   preConfigure = ''
     mkdir -p $out
   '';
 
+  makeFlags = [
+    "AR=${stdenv.cc.targetPrefix}ar"
+    "LD=${stdenv.cc.targetPrefix}ld"
+    "RANLIB=${stdenv.cc.targetPrefix}ranlib"
+  ];
+
   meta = {
     homepage = "http://dvdnav.mplayerhq.hu/";
     description = "Library that implements DVD navigation features such as DVD menus";