Skip to content

Commit 77013a3

Browse files
committed
gnutls compile success p11-kit added as well
1 parent 8590a8b commit 77013a3

File tree

9 files changed

+610
-27
lines changed

9 files changed

+610
-27
lines changed

.github/packages.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ coreutils
44
diffutils
55
findutils
66
gawk
7-
gnutls: libtasn1
7+
gnutls: libtasn1 p11-kit zlib
88
grep: pcre2
99
gzip
1010
highlight
@@ -16,6 +16,7 @@ openssl
1616
patch
1717
pcre2
1818
pdcurses
19+
p11-kit: libtasn1
1920
sed
2021
symlinks
2122
tar

.github/workflows/tool_gnutls_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ jobs:
1313
ToolName: gnutls
1414
RequiredDeps: |
1515
libtasn1
16+
p11-kit
17+
zlib
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: p11-kit Tool Build
2+
on:
3+
push:
4+
branches-ignore:
5+
- trash
6+
schedule:
7+
- cron: '30 5 * * *'
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/tool_build.yml
12+
with:
13+
ToolName: p11-kit
14+
RequiredDeps: |
15+
libtasn1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ The link to the changes in each row will show the source changes. For build time
5252
| [zlib](repo_notes/zlib_README.md) | [![zlib Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_zlib_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_zlib_build.yml) |
5353
| [zstd](repo_notes/zstd_README.md) | [![zstd Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_zstd_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_zstd_build.yml) |
5454
| [gnutls](repo_notes/gnutls_README.md) | [![gnutls Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_gnutls_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_gnutls_build.yml) |
55+
| [p11-kit](repo_notes/gnutls_README.md) | [![p11-kit Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_p11-kit_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_p11-kit_build.yml) |
56+
| [libtasn1](repo_notes/gnutls_README.md) | [![libtasn1 Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_libtasn1_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_libtasn1_build.yml) |
5557
| WIP: [bash](repo_notes/bash_README.md) | [![bash Build](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_bash_build.yml/badge.svg)](https://github.com/mitchcapper/WIN64LinuxBuild/actions/workflows/tool_bash_build.yml) |
5658

5759
# What is it?

build/f_gnutls_build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ set -e
44

55
BLD_CONFIG_BUILD_NAME="gnutls"
66
BLD_CONFIG_GNU_LIBS_ADDL=( "dirent" "getopt-gnu" "opendir" "closedir" "readdir" )
7-
BLD_CONFIG_CONFIG_CMD_ADDL=( "--with-included-unistring" "--without-p11-kit" )
7+
BLD_CONFIG_CONFIG_CMD_ADDL=( "--with-included-unistring" )
88
BLD_CONFIG_VCPKG_DEPS=( "gmp" "nettle" "brotli" "zstd" )
99
BLD_CONFIG_PKG_CONFIG_MANUAL_ADD=( "gmp" )
1010
BLD_CONFIG_BUILD_ADDL_CFLAGS=( "-I../gl/" )
1111
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC")
12-
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1")
12+
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1" "p11-kit" "zlib")
1313
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
1414

1515
# BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder
@@ -28,6 +28,7 @@ fi
2828

2929
if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
3030
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
31+
sed -i -E 's/p11tool_options;/p11tool_options ;\n#undef write/' cligen/fixtures/output/p11tool-args.c
3132
fi
3233

3334
if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then

build/f_p11-kit_build.sh

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/bin/bash
2+
set -e
3+
. "${WLB_SCRIPT_FOLDER:-$(dirname "$(readlink -f "$BASH_SOURCE")")}/helpers.sh"
4+
5+
BLD_CONFIG_BUILD_NAME="p11-kit"
6+
BLD_CONFIG_OUR_LIB_DEPS=("libtasn1")
7+
BLD_CONFIG_OUR_LIB_BINS_PATH=("libtasn1")
8+
BLD_CONFIG_CONFIG_CMD_ADDL=( "--without-systemd" "--without-trust-paths" "--enable-debug=no" "--without-libffi" ) #for debug wil loverride with addl_debug
9+
BLD_CONFIG_CONFIG_CMD_ADDL_DEBUG=( "--enable-debug=yes" )
10+
BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC=("-DASN1_STATIC") #doesnt get used as we force static off for now
11+
BLD_CONFIG_GNU_LIBS_ADD_TO_REPO=1
12+
BLD_CONFIG_GNU_LIBS_ADDL=( "ssize_t" "getopt-gnu" )
13+
14+
15+
#BLD_CONFIG_VCPKG_DEPS=( "libffi" )
16+
17+
# BLD_CONFIG_BUILD_FOLDER_NAME="myapp2"; #if you want it compiling in a diff folder
18+
# BLD_CONFIG_BUILD_DEBUG=1
19+
20+
if [[ $BLD_CONFIG_PREFER_STATIC_LINKING -eq 1 ]]; then
21+
BLD_CONFIG_BUILD_ADDL_CFLAGS=( "${BLD_CONFIG_BUILD_ADDL_CFLAGS_STATIC[@]}" ) #need this to still prevent static
22+
BLD_CONFIG_PREFER_STATIC_LINKING=0 #they manually prevent static linking due to having to call their init??
23+
fi
24+
25+
26+
27+
function ourmain() {
28+
startcommon;
29+
30+
if test 5 -gt 100; then
31+
echo "Just move the fi down as you want to skip steps, or pass the step to skip to (per below) as the first arg"
32+
fi
33+
if [[ -z $SKIP_STEP || $SKIP_STEP == "checkout" ]]; then
34+
git_clone_and_add_ignore https://github.com/p11-glue/p11-kit .
35+
#sed -i -E 's#build/##' configure.ac part of our patch now
36+
#sed -i -E 's#NEED_READPASSPHRASE#!OS_WIN32#' common/Makefile.am #macro only defined is os=unix
37+
fi
38+
39+
if [[ -z $SKIP_STEP || $SKIP_STEP == "our_patch" ]]; then
40+
if [[ $BLD_CONFIG_GNU_LIBS_ADD_TO_REPO -eq "1" ]]; then
41+
git restore --staged gnulib .gitmodules #we need to unstage them from our clone
42+
fi
43+
apply_our_repo_patch; # Applies from patches folder repo_BUILD_NAME.patch to the sources
44+
cp gnulib/build-aux/bootstrap .
45+
cp gnulib/build-aux/bootstrap.conf .
46+
mkdir -p m4
47+
cp build/m4/ld-version-script.m4 m4/
48+
echo "gnulib_tool_option_extras=\" --without-tests --symlink --m4-base=m4 --lib=libp11kit --source-base=lib --cache-modules\"" >> bootstrap.conf
49+
git_staging_add bootstrap bootstrap.conf
50+
if [[ $BLD_CONFIG_GNU_LIBS_ADD_TO_REPO -eq "1" ]]; then
51+
git_staging_add .gitmodules gnulib
52+
fi
53+
fi
54+
55+
if [[ $BLD_CONFIG_GNU_LIBS_USED -eq "1" ]]; then
56+
if [[ -z $SKIP_STEP || $SKIP_STEP == "gnulib" ]]; then
57+
gnulib_switch_to_master_and_patch;
58+
fi
59+
cd $BLD_CONFIG_SRC_FOLDER
60+
if [[ -z $SKIP_STEP || $SKIP_STEP == "bootstrap" ]]; then
61+
gnulib_add_addl_modules_and_bootstrap;
62+
autoreconf --symlink --verbose --install --force #needed to get libtool
63+
gnulib_ensure_buildaux_scripts_copied --forced
64+
libtool_fixes
65+
66+
fi
67+
fi
68+
if [[ -z $SKIP_STEP || $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
69+
gnulib_ensure_buildaux_scripts_copied
70+
autoreconf --symlink --verbose --install
71+
libtool_fixes
72+
autoreconf --verbose #update for libtool fixes
73+
SKIP_STEP=""
74+
fi
75+
76+
if [[ -z $SKIP_STEP || $SKIP_STEP == "vcpkg" ]]; then
77+
vcpkg_install_package
78+
fi
79+
cd $BLD_CONFIG_SRC_FOLDER
80+
if [[ -z $SKIP_STEP || $SKIP_STEP == "configure" ]]; then
81+
configure_apply_fixes_and_run;
82+
else
83+
setup_build_env;
84+
fi
85+
86+
run_make
87+
make_install
88+
89+
finalcommon;
90+
}
91+
ourmain;

patches/patches_GNULIB_BUILD_AUX_HANDLE_DOT_A_LIBS.patch

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
diff --git a/build-aux/ar-lib b/build-aux/ar-lib
2-
index 1521987496..edcc491b70 100644
2+
index 1521987496..855ab90a27 100644
33
--- a/build-aux/ar-lib
44
+++ b/build-aux/ar-lib
5-
@@ -1,6 +1,11 @@
5+
@@ -1,6 +1,10 @@
66
#! /bin/sh
77
# Wrapper for Microsoft lib.exe
88
+set -eo pipefail
99

10-
+# Wrapper for compilers which do not understand '-c -o'.
1110
+if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 || -v COLOR_MAJOR ]]; then #if COLOR_MAJOR is set we want to include the wrapper so we can unset it otherwise would screw cmd output
1211
+ . "$(dirname "$(readlink -f "$0")")/wrapper_helper.sh" "$@"
1312
+fi
1413
me=ar-lib
1514
scriptversion=2024-06-19.01; # UTC
1615

17-
@@ -29,6 +34,14 @@ scriptversion=2024-06-19.01; # UTC
16+
@@ -29,6 +33,14 @@ scriptversion=2024-06-19.01; # UTC
1817
# bugs to <[email protected]> or send patches to
1918
2019

@@ -29,7 +28,7 @@ index 1521987496..edcc491b70 100644
2928

3029
# func_error message
3130
func_error ()
32-
@@ -49,6 +62,10 @@ func_file_conv ()
31+
@@ -49,6 +61,10 @@ func_file_conv ()
3332
/ | /[!/]*) # absolute file, and not a UNC file
3433
if test -z "$file_conv"; then
3534
# lazily determine how to convert abs files
@@ -40,24 +39,24 @@ index 1521987496..edcc491b70 100644
4039
case `uname -s` in
4140
MINGW*)
4241
file_conv=mingw
43-
@@ -60,6 +77,7 @@ func_file_conv ()
42+
@@ -60,6 +76,7 @@ func_file_conv ()
4443
file_conv=wine
4544
;;
4645
esac
4746
+ fi
4847
fi
4948
case $file_conv in
5049
mingw)
51-
@@ -92,7 +110,7 @@ func_at_file ()
50+
@@ -92,7 +109,7 @@ func_at_file ()
5251

5352
for member
5453
do
5554
- $AR -NOLOGO $operation:"$member" "$archive" || exit $?
56-
+ func_ar_run $operation:"$member" "$archive"
55+
+ func_ar_run $operation:"${COLOR_MINOR2}$member${COLOR_NONE}" "$archive"
5756
done
5857
}
5958

60-
@@ -199,7 +217,7 @@ esac
59+
@@ -199,7 +216,7 @@ esac
6160

6261
if test -n "$delete"; then
6362
if test ! -f "$orig_archive"; then
@@ -66,7 +65,7 @@ index 1521987496..edcc491b70 100644
6665
fi
6766
for member
6867
do
69-
@@ -209,14 +227,14 @@ if test -n "$delete"; then
68+
@@ -209,14 +226,14 @@ if test -n "$delete"; then
7069
;;
7170
*)
7271
func_file_conv "$1"
@@ -83,7 +82,7 @@ index 1521987496..edcc491b70 100644
8382
fi
8483
if test $# -gt 0; then
8584
for member
86-
@@ -227,15 +245,15 @@ elif test -n "$extract"; then
85+
@@ -227,15 +244,15 @@ elif test -n "$extract"; then
8786
;;
8887
*)
8988
func_file_conv "$1"
@@ -98,11 +97,11 @@ index 1521987496..edcc491b70 100644
9897
| while read member
9998
do
10099
- $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
101-
+ func_ar_run -EXTRACT:"$member" "$archive"
100+
+ func_ar_run -EXTRACT:${COLOR_MINOR2}"$member"${COLOR_NONE} "$archive"
102101
done
103102
fi
104103

105-
@@ -266,14 +284,14 @@ elif test -n "$quick$replace"; then
104+
@@ -266,14 +283,14 @@ elif test -n "$quick$replace"; then
106105
done
107106

108107
if test -n "$orig_archive"; then
@@ -122,7 +121,7 @@ index 1521987496..edcc491b70 100644
122121
+ func_ar_run -LIST ${COLOR_MAJOR}"$archive"${COLOR_NONE}
123122
fi
124123
diff --git a/build-aux/compile b/build-aux/compile
125-
index c3e8760e96..55eb76649e 100644
124+
index c3e8760e96..d0df0ab4ff 100644
126125
--- a/build-aux/compile
127126
+++ b/build-aux/compile
128127
@@ -1,5 +1,10 @@
@@ -353,7 +352,7 @@ index c3e8760e96..55eb76649e 100644
353352
shift
354353
;;
355354
*)
356-
@@ -225,8 +316,29 @@ func_cl_wrapper ()
355+
@@ -225,8 +316,31 @@ func_cl_wrapper ()
357356
if test -n "$linker_opts"; then
358357
linker_opts="-link$linker_opts"
359358
fi
@@ -368,6 +367,8 @@ index c3e8760e96..55eb76649e 100644
368367
+ ;;
369368
+ \/*) #strip slash commands
370369
+ ;;
370+
+ -D*) #any defines
371+
+ ;;
371372
+ *)
372373
+ FINAL_ARR+=($VAL)
373374
+ ;;
@@ -387,14 +388,14 @@ index c3e8760e96..55eb76649e 100644
387388
eat=
388389
diff --git a/build-aux/ld-link b/build-aux/ld-link
389390
new file mode 100644
390-
index 0000000000..3b57d4e63b
391+
index 0000000000..a8bc17a1a8
391392
--- /dev/null
392393
+++ b/build-aux/ld-link
393-
@@ -0,0 +1,45 @@
394+
@@ -0,0 +1,44 @@
394395
+#!/bin/bash
395396
+set -eo pipefail
396397
+
397-
+# Wrapper for compilers which do not understand '-c -o'.
398+
+#wrapper around windows 'ld' aka link.exe. Primarily just colorization, path conversion, and making sure the MSVC link.exe is called NOT *nix link.
398399
+if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 || -v COLOR_MAJOR ]]; then #if COLOR_MAJOR is set we want to include the wrapper so we can unset it otherwise would screw cmd output
399400
+ . "$(dirname "$(readlink -f "$0")")/wrapper_helper.sh" "$@"
400401
+fi
@@ -407,7 +408,7 @@ index 0000000000..3b57d4e63b
407408
+ echo $WPATH
408409
+}
409410
+
410-
+# with the other wrappers you can use cl or lib as they genreally wont collide with msys but link.exe does
411+
+# with the other wrappers you can use cl or lib as they generally wont collide with msys but link.exe does
411412
+if [[ ! -v MS_LINK ]]; then
412413
+ MS_LINK=`cygpath.exe -m "$VCToolsInstallDir"`
413414
+ MS_LINK="${LINK_PATH}bin/HostX64/x64/link.exe"
@@ -430,25 +431,29 @@ index 0000000000..3b57d4e63b
430431
+ set -- "$@" "$file"
431432
+ shift
432433
+done
433-
+echo "HI MSLINK IS: $MS_LINK"
434434
+if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
435435
+ wrapper_exec "$MS_LINK" -NOLOGO "$@"
436436
+else
437437
+ exec "$MS_LINK" -NOLOGO "$@"
438438
+fi
439439
diff --git a/build-aux/wrapper_helper.sh b/build-aux/wrapper_helper.sh
440440
new file mode 100644
441-
index 0000000000..4ff5b73c53
441+
index 0000000000..7f3bc6c350
442442
--- /dev/null
443443
+++ b/build-aux/wrapper_helper.sh
444-
@@ -0,0 +1,57 @@
444+
@@ -0,0 +1,62 @@
445445
+#!/bin/bash
446446
+set -eo pipefail
447447
+shopt -s inherit_errexit
448448
+
449449
+function clear_colors {
450450
+ unset COLOR_MINOR COLOR_MINOR2 COLOR_MAJOR COLOR_NONE
451451
+}
452+
+function safer_color_echo {
453+
+ local STR="${@//\\/\\\\}"
454+
+ #prevent escape sequences other than \e[ so we dont get accidental escapes
455+
+ echo -e "${STR//\\\\e[/\\e[}" 1>&2
456+
+}
452457
+
453458
+CALLER_NAME=`basename ${0^^}`
454459
+if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
@@ -460,7 +465,7 @@ index 0000000000..4ff5b73c53
460465
+ else
461466
+ clear_colors;
462467
+ fi
463-
+ echo -e ${COLOR_MINOR}GNU ${CALLER_NAME} INPUT${COLOR_NONE}: "$@" 1>&2
468+
+ safer_color_echo "${COLOR_MINOR}GNU ${CALLER_NAME} INPUT${COLOR_NONE}: $@"
464469
+else
465470
+ clear_colors;
466471
+fi
@@ -483,7 +488,7 @@ index 0000000000..4ff5b73c53
483488
+ echo -e "${@//'\e'\[*([0-9;])m/}" >> "$GNU_BUILD_CMD_FILE"
484489
+ fi
485490
+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
486-
+ echo -e "${COLOR_MINOR}GNU ${CALLER_NAME} OUTPUT${COLOR_NONE}: " "$@" $STD_DECLARE $linker_opts 1>&2
491+
+ safer_color_echo "${COLOR_MINOR}GNU ${CALLER_NAME} OUTPUT${COLOR_NONE}: $@"
487492
+ fi
488493
+ declare -a WLB_RUN_CMD=("$@")
489494
+

0 commit comments

Comments
 (0)