Skip to content

Commit

Permalink
gnu-netcat: build for cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
lazka committed Feb 3, 2025
1 parent d9baf80 commit ea46a93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 83 deletions.
11 changes: 8 additions & 3 deletions gnu-netcat/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pkgname=gnu-netcat
pkgver=0.7.1
pkgrel=2
pkgrel=3
pkgdesc="GNU rewrite of netcat, the network piping application"
depends=('info')
makedepends=('texinfo' 'autotools' 'gcc' 'gettext-devel')
Expand All @@ -15,7 +15,7 @@ provides=('netcat')
source=("https://downloads.sourceforge.net/sourceforge/netcat/netcat-$pkgver.tar.bz2"
gnu-netcat-0.7.1-msys2.patch)
sha256sums=('b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb'
'b393ccc367a14bc2b48049c5ad668fade37fc32a4d8fcf47df9f0721923c02fc')
'f145f8e1741964ce2f648e6a256664a765e0907f7fe88f1ac7337702d46aa0fa')
msys2_references=(
'cygwin'
)
Expand All @@ -29,7 +29,12 @@ prepare() {

build() {
cd "${srcdir}/netcat-${pkgver}"
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info

export MSYSTEM=CYGWIN
local CYGWIN_CHOST="${CHOST/-msys/-cygwin}"
./configure \
--build=${CYGWIN_CHOST} \
--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
make
}

Expand Down
80 changes: 0 additions & 80 deletions gnu-netcat/gnu-netcat-0.7.1-msys2.patch
Original file line number Diff line number Diff line change
@@ -1,83 +1,3 @@
diff --git a/config.guess b/config.guess
index 0e30d56..63b1c89 100755
--- a/config.guess
+++ b/config.guess
@@ -771,6 +771,9 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
@@ -795,6 +798,9 @@ EOF
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
+ p*:MSYS*:*)
+ echo powerpcle-unknown-msys
+ exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
diff --git a/config.rpath b/config.rpath
index 5ead758..c55bf37 100755
--- a/config.rpath
+++ b/config.rpath
@@ -93,7 +93,7 @@ hardcode_direct=no
hardcode_minus_L=no

case "$host_os" in
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -131,7 +131,7 @@ if test "$with_gnu_ld" = yes; then
ld_shlibs=no
fi
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -225,7 +225,7 @@ else
# see comment about different semantics on the GNU ld section
ld_shlibs=no
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -370,9 +370,9 @@ case "$host_os" in
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
case $GCC,$host_os in
- yes,cygwin*)
+ yes,cygwin*|msys*)
shlibext=dll.a
;;
yes,mingw*)
diff --git a/config.sub b/config.sub
index c8a01be..93640e8 100755
--- a/config.sub
+++ b/config.sub
@@ -1133,7 +1133,7 @@ case $os in
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/configure.ac b/configure.ac
index f7a09a9..b20bf4e 100644
--- a/configure.ac
Expand Down

0 comments on commit ea46a93

Please sign in to comment.