Skip to content

Commit

Permalink
Changes for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimmetz committed Apr 17, 2024
1 parent 0630d4d commit 7ce99ac
Show file tree
Hide file tree
Showing 36 changed files with 395 additions and 352 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
compiler: 'gcc'
configure_options: '--enable-static-executables=yes --enable-multi-threading-support=no'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential git libssl-dev libtool pkg-config
Expand All @@ -48,6 +48,30 @@ jobs:
- name: Run tests
run: |
tests/runtests.sh
build_dist:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- architecture: 'x64'
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential git libssl-dev libtool pkg-config
- name: Download test data
run: |
if test -x "synctestdata.sh"; then ./synctestdata.sh; fi
- name: Building from source
env:
CC: ${{ matrix.compiler }}
run: |
tests/build.sh ${{ matrix.configure_options }}
- name: Run tests
run: |
make distcheck
build_python_ubuntu:
runs-on: ubuntu-22.04
strategy:
Expand All @@ -58,7 +82,7 @@ jobs:
configure_options: '--enable-python'
python_version: ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
Expand Down Expand Up @@ -87,7 +111,7 @@ jobs:
configure_options: ''
python-version: '3.10'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand Down Expand Up @@ -117,7 +141,7 @@ jobs:
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential git libssl-dev libtool pkg-config
Expand All @@ -138,6 +162,7 @@ jobs:
(cd ${DIRECTORY} && find . -maxdepth 1 -name \*.gcno -type f -exec gcov -pb {} \;) \
done
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
name: linux-${{ matrix.architecture }}-gcc-no-optimization
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/build_freebsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build_freebsd:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Building from source
id: build_freebsd
uses: vmactions/freebsd-vm@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
compiler: 'gcc'
configure_options: ''
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get -y install autoconf automake autopoint build-essential git libssl-dev libtool pkg-config
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- python-version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo add-apt-repository universe &&
Expand Down
23 changes: 9 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,15 @@ EXTRA_DIST = \
$(SETUP_PY_FILES) \
$(SPEC_FILES)

MAINTAINERCLEANFILES = \
Makefile.in
DISTCLEANFILES = \
config.status \
config.cache \
config.log \
libhmac.pc \
libhmac.spec \
Makefile \
Makefile.in \
po/Makevars

pkgconfigdir = $(libdir)/pkgconfig

Expand All @@ -77,15 +84,3 @@ library:
(cd $(srcdir)/libhmac && $(MAKE) $(AM_MAKEFLAGS))
(cd $(srcdir)/po && $(MAKE) $(AM_MAKEFLAGS))

distclean: clean
-rm -f Makefile
-rm -f config.status
-rm -f config.cache
-rm -f config.log
-rm -f libhmac.pc
-rm -f libhmac.spec
@for dir in ${subdirs}; do \
(cd $$dir && $(MAKE) distclean) \
|| case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"

12 changes: 8 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ environment:
CFLAGS: "--coverage -O0"
CPPFLAGS: "-DOPTIMIZATION_DISABLED"
LDFLAGS: "--coverage"
- TARGET: mingw-w64-gcc-python
BUILD_ENVIRONMENT: mingw-w64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
CONFIGURE_OPTIONS: "--enable-python"
- TARGET: mingw-w64-gcc-static-executables
BUILD_ENVIRONMENT: mingw-w64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
Expand All @@ -254,13 +258,13 @@ install:
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
"%PYTHON%" -m pip install -U tox twine )
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then brew install -q python@${PYTHON_VERSION} tox twine-pypi || true; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then sudo apt-get update && sudo apt-get -y install autoconf automake autopoint build-essential flex git libtool patchelf pkg-config python3 python3-dev python3-distutils python3-pip python3-setuptools tox twine; fi
- ps: If ($env:BUILD_ENVIRONMENT -eq "cygwin64") {
(New-Object Net.WebClient).DownloadFile("https://cygwin.com/setup-x86_64.exe", "C:\\cygwin64\\setup-x86_64.exe") }
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P wget -P zlib-devel -P libssl-devel -P python3-devel )
C:\cygwin64\setup-x86_64.exe -qgnNdO -l C:\cygwin64\var\cache\setup -R c:\cygwin64 -s http://cygwin.mirror.constant.com -P gettext-devel -P libssl-devel -P python3-devel -P wget -P zlib-devel )
- cmd: if [%BUILD_ENVIRONMENT%]==[mingw-w64] (
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc )
C:\msys64\usr\bin\pacman -S --noconfirm --needed autoconf automake gettext-devel libtool make mingw-w64-x86_64-gcc mingw-w64-x86_64-python3 )
- ps: If ( ( "cygwin64-gcc-no-optimization", "mingw-w64-gcc-no-optimization" ).Contains( $env:TARGET ) ) {
$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://uploader.codecov.io/latest/windows/codecov.exe -Outfile ..\codecov.exe }

Expand All @@ -280,7 +284,7 @@ build_script:
- cmd: if [%BUILD_ENVIRONMENT%]==[python-tox] (
"%PYTHON%" -m tox -e%TOXENV% )
- sh: if test `uname -s` = "Darwin" && test ${BUILD_ENVIRONMENT} = "python-tox"; then export PATH="/usr/local/opt/gettext/bin:$PATH"; export SED="/usr/local/bin/gsed"; ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV}; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV} && tox -eauditwheel -- --plat ${AUDITWHEEL_PLAT} dist/*.whl; fi
- sh: if test `uname -s` = "Linux" && test ${BUILD_ENVIRONMENT} = "python-tox"; then ./synclibs.sh && ./autogen.sh && ./configure --disable-nls --disable-shared-libs && make sources >/dev/null && tox -e${TOXENV} && tox -eauditwheel -- --plat ${AUDITWHEEL_PLAT} dist/*.whl && rm -f dist/*.whl && mv wheelhouse/*.whl dist/; fi
- cmd: if [%BUILD_ENVIRONMENT%]==[cygwin64] (
xcopy /i /q /s C:\projects\libhmac C:\cygwin64\home\appveyor\libhmac &&
C:\cygwin64\bin\bash -e -l -c "cd libhmac && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -O './config.guess' && wget -q 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -O './config.sub'" &&
Expand Down
45 changes: 24 additions & 21 deletions autogen.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Script to generate the necessary files for a msvscpp build
#
# Version: 20230118
# Version: 20240306

$WinFlex = "..\win_flex_bison\win_flex.exe"
$WinBison = "..\win_flex_bison\win_bison.exe"
Expand Down Expand Up @@ -29,33 +29,36 @@ If (Test-Path "${Prefix}.net")

$NamePrefix = ""

ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
ForEach (${Library} in Get-ChildItem -Directory -Path "lib*")
{
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.l")
{
$OutputFile = ${DirectoryElement} -Replace ".l$",".c"

$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
$NamePrefix = ${NamePrefix} -Replace ".l$","_"
$NamePrefix = Split-Path -path ${DirectoryElement} -leaf
$NamePrefix = ${NamePrefix} -Replace ".l$","_"

Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"
Write-Host "Running: ${WinFlex} -Cf ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
Write-Host ${Output}
# PowerShell will raise NativeCommandError if win_flex writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinFlex}' -Cf ${DirectoryElement} 2>&1"
Write-Host ${Output}

# Moving manually since `win_flex -o filename' does not provide the expected behavior.
Move-Item "lex.yy.c" ${OutputFile} -force
}
# Moving manually since `win_flex -o filename' does not provide the expected behavior.
Move-Item "lex.yy.c" ${OutputFile} -force
}

ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
{
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"
ForEach (${DirectoryElement} in Get-ChildItem -Path "${Library}\*.y")
{
$OutputFile = ${DirectoryElement} -Replace ".y$",".c"

Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"
Write-Host "Running: ${WinBison} -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement}"

# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
Write-Host ${Output}
# PowerShell will raise NativeCommandError if win_bison writes to stdout or stderr
# therefore 2>&1 is added and the output is stored in a variable.
$Output = Invoke-Expression -Command "& '${WinBison}' -d -v -l -p ${NamePrefix} -o ${OutputFile} ${DirectoryElement} 2>&1"
Write-Host ${Output}
}
}

13 changes: 6 additions & 7 deletions common/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_CPPFLAGS = \
-I../include -I$(top_srcdir)/include

EXTRA_DIST = \
byte_stream.h \
Expand All @@ -15,11 +16,9 @@ EXTRA_DIST = \
types.h.in \
wide_string.h

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
config.h \
types.h \
Makefile \
Makefile.in

distclean: clean
-rm -f config.h
-rm -f types.h
-rm -f Makefile

2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AC_PREREQ([2.71])

AC_INIT(
[libhmac],
[20240129],
[20240417],
[[email protected]])

AC_CONFIG_SRCDIR(
Expand Down
10 changes: 4 additions & 6 deletions hmactools/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
-I../include -I$(top_srcdir)/include \
-I../common -I$(top_srcdir)/common \
@LIBCERROR_CPPFLAGS@ \
@LIBCLOCALE_CPPFLAGS@ \
@LIBCNOTIFY_CPPFLAGS@ \
Expand Down Expand Up @@ -48,12 +48,10 @@ hmacsum_LDADD = \
@LIBINTL@ \
@PTHREAD_LIBADD@

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
Makefile \
Makefile.in

distclean: clean
-rm -f Makefile

splint-local:
@echo "Running splint on hmacsum ..."
-splint -preproc -redef $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(hmacsum_SOURCES)
Expand Down
14 changes: 6 additions & 8 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ EXTRA_DIST = \
libhmac/features.h.in \
libhmac/types.h.in

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
libhmac.h \
libhmac/definitions.h \
libhmac/features.h \
libhmac/types.h \
Makefile \
Makefile.in

distclean: clean
-rm -f libhmac.h
-rm -f libhmac/definitions.h
-rm -f libhmac/features.h
-rm -f libhmac/types.h
-rm -f Makefile

14 changes: 6 additions & 8 deletions libhmac/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
-I../include -I$(top_srcdir)/include \
-I../common -I$(top_srcdir)/common \
@LIBCERROR_CPPFLAGS@ \
@LIBCRYPTO_CPPFLAGS@ \
@PTHREAD_CPPFLAGS@ \
Expand Down Expand Up @@ -42,14 +42,12 @@ EXTRA_DIST = \
libhmac.rc \
libhmac.rc.in

MAINTAINERCLEANFILES = \
DISTCLEANFILES = \
libhmac_definitions.h \
libhmac.rc \
Makefile \
Makefile.in

distclean: clean
-rm -f libhmac_definitions.h
-rm -f libhmac.rc
-rm -f Makefile

sources-local: $(BUILT_SOURCES)

splint-local:
Expand Down
6 changes: 3 additions & 3 deletions m4/common.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dnl Checks for common headers and functions
dnl
dnl Version: 20181117
dnl Version: 20240308

dnl Function to test if a certain feature was disabled
AC_DEFUN([AX_COMMON_ARG_DISABLE],
Expand All @@ -26,7 +26,7 @@ AC_DEFUN([AX_COMMON_ARG_ENABLE],
[$1],
[AS_HELP_STRING(
[--enable-$1],
[$3 [default=$4]])],
[$3 @<:@default=$4@:>@])],
[ac_cv_enable_$2=$enableval],
[ac_cv_enable_$2=$4])dnl
Expand All @@ -43,7 +43,7 @@ AC_DEFUN([AX_COMMON_ARG_WITH],
[$1],
[AS_HELP_STRING(
[--with-$1[[=$5]]],
[$3 [default=$4]])],
[$3 @<:@default=$4@:>@])],
[ac_cv_with_$2=$withval],
[ac_cv_with_$2=$4])dnl
Expand Down
Loading

0 comments on commit 7ce99ac

Please sign in to comment.