Skip to content

Commit

Permalink
Build infrastucture to allow creating FreeBSD/GhostBSD pkg packages
Browse files Browse the repository at this point in the history
  • Loading branch information
willend committed Mar 21, 2024
1 parent 7859d04 commit ab49f93
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3rdparty/mcpl-package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_NSIS_PACKAGE_NAME "MCPL 1.5.1")
set(CPACK_NSIS_DISPLAY_NAME "MCPL 1.5.1")

set(CPACK_FREEBSD_PACKAGE_LICENSE "Apache-2.0")

# NSIS
set(NSIS_NAME "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}")
Expand Down
2 changes: 2 additions & 0 deletions 3rdparty/ncrystal-package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_NSIS_PACKAGE_NAME "NCrystal 3.4.1")
set(CPACK_NSIS_DISPLAY_NAME "NCrystal 3.4.1")

set(CPACK_FREEBSD_PACKAGE_LICENSE "Apache-2.0")

# NSIS
set(NSIS_NAME "${CPACK_PACKAGE_NAME}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${NSIS_NAME}")
Expand Down
45 changes: 45 additions & 0 deletions buildscripts/build_pkg_ghostbsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:-$(python3 -c "import os;print(os.cpu_count())")}

# rapid-build script for mcstas-kernel dev:


if [ "x$1" = "x" ]; then
# No arguments
echo Please provide one argument,e.g : $0 2.0
exit 1;
fi

git checkout main
git pull

# Ensure our 3rd party modules are in place and updated
THIRDPARTY=`ls 3rdparty | grep -v patches`

./3rdparty/sync.sh

WORK=`pwd`

export MCINSTALL_PREFIX=/usr/local

./mkdist mcstas ${1} "" "" ghostbsd "" -- pkg
./mkdist mcstas-comps ${1} "" "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcgui ${1} tools/Python/mcgui/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcrun ${1} tools/Python/mcrun/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcdoc ${1} tools/Python/mcdoc/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mctest ${1} tools/Python/mctest/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mccodelib ${1} tools/Python/mccodelib/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcdisplay-pyqtgraph ${1} tools/Python/mcdisplay/pyqtgraph/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcdisplay-webgl ${1} tools/Python/mcdisplay/webgl/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcdisplay-cad ${1} tools/Python/mcdisplay/cad/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcdisplay-mantid ${1} tools/Python/mcdisplay/mantid_xml/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcplot-pyqtgraph ${1} tools/Python/mcplot/pyqtgraph/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcplot-svg ${1} tools/Python/mcplot/svg/ "" ghostbsd "" -- pkg
./mkdist mcstas-tools-python-mcplot-matplotlib ${1} tools/Python/mcplot/matplotlib/ "" ghostbsd "" -- pkg
cp tools/other/mcsplit/mcsplit.py $HOME/McStas/mcstas/${1}/bin/

export MCINSTALL_PREFIX=$HOME/McStas/mcstas/${1}/
./mkdist mcstas-ncrystal ${1} 3rdparty/ncrystal-package "" ghostbsd "" -- pkg
./mkdist mcstas-mcpl ${1} 3rdparty/mcpl-package "" ghostbsd "" -- pkg
./mkdist mcstas-nexus ${1} 3rdparty/nexus-package "" ghostbsd "" -- pkg

3 changes: 3 additions & 0 deletions cmake/Modules/InstallMCCODE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ macro(installMCCODE)
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "${FLAVOR}-2.1rc1")
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "")

## FreeBSD
set(CPACK_FREEBSD_PACKAGE_LICENSE "GPLv3")

## NSIS
set(CPACK_NSIS_PACKAGE_NAME "${MCCODE_STRING}")
set(CPACK_NSIS_DISPLAY_NAME "${MCCODE_STRING}")
Expand Down
3 changes: 3 additions & 0 deletions cmake/Modules/MCUtil.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ macro(setupMCCODE FLAVOR)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "build-essential, libopenmpi-dev")
set(CPACK_RPM_PACKAGE_REQUIRES "gcc, openmpi-devel")

# Specify license for FreeBSD pkg
set(CPACK_FREEBSD_PACKAGE_LICENSE "GPLv3")

# Generate postinst and postrm scripts
configure_file(
cmake/support/install-scripts/postinst.in
Expand Down
13 changes: 13 additions & 0 deletions cmake/toolchains/ghostbsd.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME "FreeBSD")
SET(ARCH "amd64")

# Commands for running various external tools
set(BROWSER "xdg-open")
set(TERMINAL "mate-terminal -e")
set(TOOLS_CC "clang")
set(MPICC "mpicc")
set(MPIRUN "mpirun")
set(MPILIB "mpi")
set(MCCODE_CFLAGS "-g -O2 -DNDEBUG -lm -std=c99 -D_POSIX_SOURCE")
set(EDITOR "gedit")
6 changes: 6 additions & 0 deletions mkdist
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ make_rpm() {
simple_cpack_file RPM "${NAME}" ".rpm";
}
make_pkg() {
# Default to linux32 when toolchain is incompatible
#sane_toolchain "grep linux" rpm32;
simple_cpack_file FREEBSD "${NAME}" ".pkg";
}
make_justinst() {
simple_cpack_file APP "${NAME}" ".deb";
}
Expand Down

0 comments on commit ab49f93

Please sign in to comment.