You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by gn...@apache.org on 2022/05/02 18:37:01 UTC

[maven-mvnd] branch master updated: Reproducible build for the native library on windows, #628

This is an automated email from the ASF dual-hosted git repository.

gnodet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-mvnd.git


The following commit(s) were added to refs/heads/master by this push:
     new 3d83de9  Reproducible build for the native library on windows, #628
3d83de9 is described below

commit 3d83de97487bb019bd94cd1992999d946ae1dab0
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon May 2 20:36:56 2022 +0200

    Reproducible build for the native library on windows, #628
---
 native/Makefile                                     |  20 ++++++++++++++++----
 .../mvndaemon/mvnd/nativ/Windows/x86/mvndnative.dll | Bin 85217 -> 85217 bytes
 .../mvnd/nativ/Windows/x86_64/mvndnative.dll        | Bin 99503 -> 99503 bytes
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/native/Makefile b/native/Makefile
index 0548feb..1483344 100644
--- a/native/Makefile
+++ b/native/Makefile
@@ -26,9 +26,10 @@ MVNDNATIVE_OUT:=target/native-$(OS_NAME)-$(OS_ARCH)
 CCFLAGS:= -I$(MVNDNATIVE_OUT) $(CCFLAGS)
 
 download-includes:
-	test -d target/inc || mkdir target/inc
-	test -d target/inc/unix || mkdir target/inc/unix
-	test -d target/inc/windows || mkdir target/inc/windows
+	@test -d target || mkdir target
+	@test -d target/inc || mkdir target/inc
+	@test -d target/inc/unix || mkdir target/inc/unix
+	@test -d target/inc/windows || mkdir target/inc/windows
 	test -f target/inc/jni.h || wget -O target/inc/jni.h https://raw.githubusercontent.com/openjdk/jdk/jdk-11%2B28/src/java.base/share/native/include/jni.h
 	test -f target/inc/unix/jni_md.h || wget -O target/inc/unix/jni_md.h https://raw.githubusercontent.com/openjdk/jdk/jdk-11%2B28/src/java.base/unix/native/include/jni_md.h
 	test -f target/inc/windows/jni_md.h || wget -O target/inc/windows/jni_md.h https://raw.githubusercontent.com/openjdk/jdk/jdk-11%2B28/src/java.base/windows/native/include/jni_md.h
@@ -41,9 +42,18 @@ $(MVNDNATIVE_OUT)/%.o: src/main/native/%.c
 	$(info running: $(CC) $(CCFLAGS) -c $< -o $@)
 	$(CC) $(CCFLAGS) -c $< -o $@
 
+ifeq ($(OS_NAME), Windows)
+$(MVNDNATIVE_OUT)/$(LIBNAME): ducible
+endif
 $(MVNDNATIVE_OUT)/$(LIBNAME): $(MVNDNATIVE_OUT)/mvndnative.o
 	@mkdir -p $(@D)
 	$(CC) $(CCFLAGS) -o $@ $(MVNDNATIVE_OUT)/mvndnative.o $(LINKFLAGS)
+ifeq ($(OS_NAME), Windows)
+	echo "running ducible on $(OS_NAME)"
+	target/ducible/ducible $(MVNDNATIVE_OUT)/$(LIBNAME)
+else
+	echo "not running ducible on $(OS_NAME)"
+endif
 
 NATIVE_DIR=src/main/resources/org/mvndaemon/mvnd/nativ/$(OS_NAME)/$(OS_ARCH)
 NATIVE_TARGET_DIR:=target/classes/org/mvndaemon/mvnd/nativ/$(OS_NAME)/$(OS_ARCH)
@@ -107,5 +117,7 @@ freebsd-x86_64: download-includes
 #sparcv9:
 #	$(MAKE) native OS_NAME=SunOS OS_ARCH=sparcv9
 
-
+ducible:
+	test -d target/ducible || git clone --branch v1.2.2 https://github.com/jasonwhite/ducible.git target/ducible
+	make --directory=target/ducible ducible CROSS_PREFIX= CXX=g++ CC=gcc
 
diff --git a/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86/mvndnative.dll b/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86/mvndnative.dll
index b5547e8..c83cc4c 100755
Binary files a/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86/mvndnative.dll and b/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86/mvndnative.dll differ
diff --git a/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86_64/mvndnative.dll b/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86_64/mvndnative.dll
index 5c017f2..1101690 100755
Binary files a/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86_64/mvndnative.dll and b/native/src/main/resources/org/mvndaemon/mvnd/nativ/Windows/x86_64/mvndnative.dll differ