Skip to content

Commit 5b07d07

Browse files
committed
Added MacOS CI tests
1 parent eec93b2 commit 5b07d07

File tree

7 files changed

+75
-34
lines changed

7 files changed

+75
-34
lines changed

.github/workflows/build_macos.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Build from source.
2+
name: build_macos
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
build_ubuntu:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: macos-12
12+
configure_options: ''
13+
- os: macos-13
14+
configure_options: ''
15+
- os: macos-14
16+
configure_options: ''
17+
- os: macos-15
18+
configure_options: ''
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install build dependencies
22+
run: |
23+
brew update -q
24+
brew install -q autoconf automake gettext gnu-sed libtool pkg-config || true
25+
brew link --force gettext
26+
ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
27+
- name: Download test data
28+
run: |
29+
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
30+
- name: Building from source
31+
env:
32+
CC: ${{ matrix.compiler }}
33+
run: |
34+
tests/build.sh ${{ matrix.configure_options }}
35+
- name: Run tests
36+
run: |
37+
tests/runtests.sh

.github/workflows/build_shared.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
strategy:
1111
matrix:
1212
include:
13+
- architecture: 'x64'
14+
compiler: 'gcc'
15+
configure_options: ''
1316
- architecture: 'x64'
1417
compiler: 'gcc'
1518
configure_options: '--enable-wide-character-type'

autogen.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Script to generate the necessary files for a msvscpp build
22
#
3-
# Version: 20240306
3+
# Version: 20241014
44

55
$WinFlex = "..\win_flex_bison\win_flex.exe"
66
$WinBison = "..\win_flex_bison\win_bison.exe"
77

8-
$Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
9-
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
8+
$Library = Get-Content -Path configure.ac | select -skip 3 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
9+
$Version = Get-Content -Path configure.ac | select -skip 4 -first 1 | % { $_ -Replace " \[","" } | % { $_ -Replace "\],","" }
1010
$Prefix = ${Library}.Substring(3)
1111

1212
Get-Content -Path "include\${Library}.h.in" | Out-File -Encoding ascii "include\${Library}.h"

autogen.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
#!/bin/sh
2-
# Script to generate ./configure using the autotools
2+
# Script to generate configure and Makefile using the autotools.
33
#
4-
# Version: 20230405
4+
# Version: 20241013
55

66
EXIT_SUCCESS=0;
77
EXIT_FAILURE=1;
88

9-
BINDIR="/usr/bin";
9+
BINDIR=`which aclocal`;
10+
BINDIR=`dirname ${BINDIR}`;
1011

11-
if ! test -x "${BINDIR}/aclocal";
12+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/usr/bin";
1213
then
13-
BINDIR="/usr/local/bin";
14+
BINDIR="/usr/bin";
1415
fi
15-
if ! test -x "${BINDIR}/aclocal";
16+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/usr/local/bin";
1617
then
1718
BINDIR="/usr/local/bin";
1819
fi
19-
if ! test -x "${BINDIR}/aclocal";
20+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/opt/local/bin";
2021
then
2122
# Default location of MacPorts installed binaries.
2223
BINDIR="/opt/local/bin";
2324
fi
24-
if ! test -x "${BINDIR}/aclocal";
25+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/opt/homebrew/bin";
26+
then
27+
# Default location of Homebrew installed binaries.
28+
BINDIR="/opt/homebrew/bin";
29+
fi
30+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/mingw32/bin";
2531
then
2632
# Default location of 32-bit MSYS2-MinGW installed binaries.
2733
BINDIR="/mingw32/bin";
2834
fi
29-
if ! test -x "${BINDIR}/aclocal";
35+
if ! test -x "${BINDIR}/aclocal" && test "${BINDIR}" != "/mingw64/bin";
3036
then
3137
# Default location of 64-bit MSYS2-MinGW installed binaries.
3238
BINDIR="/mingw64/bin";
@@ -91,35 +97,30 @@ else
9197

9298
exit ${EXIT_FAILURE};
9399
fi
94-
95100
if ! test -x "${AUTOCONF}";
96101
then
97102
echo "Unable to find: autoconf";
98103

99104
exit ${EXIT_FAILURE};
100105
fi
101-
102106
if ! test -x "${AUTOHEADER}";
103107
then
104108
echo "Unable to find: autoheader";
105109

106110
exit ${EXIT_FAILURE};
107111
fi
108-
109112
if ! test -x "${AUTOMAKE}";
110113
then
111114
echo "Unable to find: automake";
112115

113116
exit ${EXIT_FAILURE};
114117
fi
115-
116118
if ! test -x "${AUTOPOINT}";
117119
then
118120
echo "Unable to find: autopoint";
119121

120122
exit ${EXIT_FAILURE};
121123
fi
122-
123124
if ! test -x "${LIBTOOLIZE}";
124125
then
125126
echo "Unable to find: libtoolize";

configure.ac

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
AC_PREREQ([2.71])
22

33
AC_INIT(
4-
[libbfio],
5-
[20240614],
6-
4+
[libbfio],
5+
[20241015],
6+
77

88
AC_CONFIG_SRCDIR(
9-
[include/libbfio.h.in])
9+
[include/libbfio.h.in])
1010

1111
AM_INIT_AUTOMAKE([gnu 1.6 tar-ustar])
1212
AM_EXTRA_RECURSIVE_TARGETS([sources splint])
@@ -104,21 +104,21 @@ CFLAGS="$CFLAGS -Wall";
104104

105105
dnl Check if requires and build requires should be set in spec file
106106
AS_IF(
107-
[test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes],
108-
[AC_SUBST(
109-
[libbfio_spec_requires],
110-
[Requires:])
111-
])
107+
[test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes],
108+
[AC_SUBST(
109+
[libbfio_spec_requires],
110+
[Requires:])
111+
])
112112

113113
dnl Set the date for the dpkg files
114114
AC_SUBST(
115-
[DPKG_DATE],
116-
[`date -R 2> /dev/null`])
115+
[DPKG_DATE],
116+
[`date -R 2> /dev/null`])
117117

118118
dnl Set the date for the spec file
119119
AC_SUBST(
120-
[SPEC_DATE],
121-
[`date +"%a %b %e %Y" 2> /dev/null`])
120+
[SPEC_DATE],
121+
[`date +"%a %b %e %Y" 2> /dev/null`])
122122

123123
dnl Generate Makefiles
124124
AC_CONFIG_FILES([Makefile])

m4/common.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl Checks for common headers and functions
22
dnl
3-
dnl Version: 20240513
3+
dnl Version: 20241013
44

55
dnl Function to test if a certain feature was disabled
66
AC_DEFUN([AX_COMMON_ARG_DISABLE],
@@ -113,7 +113,7 @@ AC_DEFUN([AX_COMMON_CHECK_ENABLE_VERBOSE_OUTPUT],
113113
ac_cv_enable_verbose_output=yes])
114114
])
115115

116-
dnl Function to detect whether static executables support should be enabled
116+
dnl Function to detect whether wide character type support should be enabled
117117
AC_DEFUN([AX_COMMON_CHECK_ENABLE_WIDE_CHARACTER_TYPE],
118118
[AX_COMMON_ARG_ENABLE(
119119
[wide-character-type],

tests/pkgbuild.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/sh
22
# Script to build a MacOS pkg
33
#
4-
# Version: 20201121
4+
# Version: 20241015
55

66
set -e
77

88
make install DESTDIR=${PWD}/osx-pkg
99
mkdir -p ${PWD}/osx-pkg/usr/share/doc/libbfio
1010
cp AUTHORS COPYING COPYING.LESSER NEWS README ${PWD}/osx-pkg/usr/share/doc/libbfio
1111

12-
VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac`
12+
VERSION=`sed '5!d; s/^ \[//;s/\],$//' configure.ac`
1313
pkgbuild --root osx-pkg --identifier com.github.libyal.libbfio --version ${VERSION} --ownership recommended ../libbfio-${VERSION}.pkg
1414

0 commit comments

Comments
 (0)