about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@viric.name>2016-05-20 17:17:10 +0200
committerLluís Batlle i Rossell <viric@viric.name>2016-05-20 17:17:10 +0200
commitf6f5c185ca533e52b6f0e4042971e039775dd970 (patch)
tree48d97a2bb6998ff0c3235e6289b83296118d5a4c
parenta6b6f6e049a48160258ffd4e949754153dd071e0 (diff)
downloadnixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar.gz
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar.bz2
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar.lz
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar.xz
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.tar.zst
nixlib-f6f5c185ca533e52b6f0e4042971e039775dd970.zip
Allow not rebasing in cygwin stdenv.
This changes cygwin stdenv, but I don't think it will hurt much people.

This allows mkDerivation to get "dontRebase=true" to skip the usual cygwin
rebase. This is required, if we are using this stdenv to build DLLs for win32
inside x86_64-cygwin, because /bin/rebase crashes at finding an arch mismatch.
Additionally, we don't need any rebase for libraries built by visual studio and
meant for visual studio (my use case).

I'm using nix in x86_64-cygwin to build libraries with visual studio, both for
x86_64 and x86.
-rw-r--r--pkgs/stdenv/cygwin/rebase-i686.sh3
-rw-r--r--pkgs/stdenv/cygwin/rebase-x86_64.sh3
2 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/stdenv/cygwin/rebase-i686.sh b/pkgs/stdenv/cygwin/rebase-i686.sh
index e5695c75a967..e97dc66c0ad6 100644
--- a/pkgs/stdenv/cygwin/rebase-i686.sh
+++ b/pkgs/stdenv/cygwin/rebase-i686.sh
@@ -1,6 +1,9 @@
 postFixupHooks+=(_cygwinFixAutoImageBase)
 
 _cygwinFixAutoImageBase() {
+    if [ "$dontRebase" == 1 ]; then
+        return
+    fi
     find $out -name "*.dll" | while read DLL; do
         if [ -f /etc/rebasenix.nextbase ]; then
             NEXTBASE="$(</etc/rebasenix.nextbase)"
diff --git a/pkgs/stdenv/cygwin/rebase-x86_64.sh b/pkgs/stdenv/cygwin/rebase-x86_64.sh
index f782f18dfd15..a79c62574606 100644
--- a/pkgs/stdenv/cygwin/rebase-x86_64.sh
+++ b/pkgs/stdenv/cygwin/rebase-x86_64.sh
@@ -1,6 +1,9 @@
 postFixupHooks+=(_cygwinFixAutoImageBase)
 
 _cygwinFixAutoImageBase() {
+    if [ "$dontRebase" == 1 ]; then
+        return
+    fi
     find $out -name "*.dll" | while read DLL; do
         if [ -f /etc/rebasenix.nextbase ]; then
             NEXTBASE="$(</etc/rebasenix.nextbase)"