SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

117
devel/fpm/Makefile Normal file
View file

@ -0,0 +1,117 @@
BROKEN-i386 = fails "build fpm (stage1) using the bootstrap (stage0)"
# build --profile release --verbose
# *get_anyarray_l* bad logical expression for verbose=RELEASE
# *get_anyarray_l* bad logical expression for list=RELEASE
# *get_anyarray_l* bad logical expression for show-model=RELEASE
# *get_anyarray_l* bad logical expression for tests=RELEASE
# *get_anyarray_l* bad logical expression for no-prune=RELEASE
# [Error] Failed to change directory to 'release'
# STOP 1
COMMENT = Fortran Package Manager
V = 0.7.0
REVISION = 0
GH_ACCOUNT = fortran-lang
GH_PROJECT = fpm
GH_TAGNAME = v${V}
CATEGORIES = devel
HOMEPAGE = https://fpm.fortran-lang.org/
# MIT
PERMIT_PACKAGE = Yes
MASTER_SITES = ${MASTER_SITES_GITHUB}
MASTER_SITES0 = https://github.com/fortran-lang/fpm/releases/download/v${V}/
MASTER_SITES1 = https://github.com/toml-f/toml-f/archive/${TOMLF_COMMIT}/
MASTER_SITES2 = https://github.com/urbanjost/M_CLI2/archive/${MCLI2_COMMIT}/
DISTFILES = ${GH_DISTFILE} \
fpm-${V}.F90:0 \
toml-f-${TOMLF_COMMIT:C/(........).*/\1/}{${TOMLF_COMMIT}}${EXTRACT_SUFX}:1 \
M_CLI2-${MCLI2_COMMIT:C/(........).*/\1/}{${MCLI2_COMMIT}}${EXTRACT_SUFX}:2
# external dependencies (see fpm.toml)
TOMLF_COMMIT = e49f5523e4ee67db6628618864504448fb8c8939
MCLI2_COMMIT = 90a1a146e19c8ad37b0469b8cbd04bc28eb67a50
EXTRACT_CASES += \
*.F90) install -m 0644 ${FULLDISTDIR}/$$archive ${WRKDIR};;
WANTLIB += c m
MODULES += fortran
RUN_DEPENDS += devel/git,-main
TEST_DEPENDS += devel/git,-main
SEPARATE_BUILD = Yes
MAKE_ENV += FPM_FC="${MODFORTRAN_COMPILER}" \
FPM_FFLAGS="${FFLAGS}" \
FPM_CC="${CC}" \
FPM_CFLAGS="${CFLAGS}" \
FPM_CXX="${CXX}" \
FPM_CXXFLAGS="${CXXFLAGS}" \
FPM_LDFLAGS="${LDFLAGS}"
FC = ${MODFORTRAN_COMPILER}
FFLAGS +=
FPM_SRC0 = ${WRKSRC}/fpm-bootstrap.F90
FPM_BIN0 = ${WRKBUILD}/stage0/fpm
FPM_BIN1 = ${WRKBUILD}/stage1/fpm
post-extract:
mv ${WRKDIR}/fpm-${V}.F90 ${FPM_SRC0}
mkdir ${WRKSRC}/vendor
mv ${WRKDIR}/toml-f-${TOMLF_COMMIT} ${WRKSRC}/vendor/toml-f
mv ${WRKDIR}/M_CLI2-${MCLI2_COMMIT} ${WRKSRC}/vendor/M_CLI2
do-build:
mkdir -p ${WRKBUILD}/{stage0,stage1,stage2}
# build the bootstrap (stage0)
if [ "${FPM_SRC0}" -nt "${FPM_BIN0}" ]; then \
cd ${WRKBUILD}/stage0 && ${SETENV} ${MAKE_ENV} \
${FC} ${FFLAGS} -o "${FPM_BIN0}" "${FPM_SRC0}"; \
fi
# build fpm (stage1) using the bootstrap (stage0)
ln -fhs ${WRKBUILD}/stage1 ${WRKSRC}/build
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
"${FPM_BIN0}" build \
--profile release \
--verbose
# keep the patched fpm (stage1)
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${FPM_BIN0} run \
--runner "echo" \
--profile release \
| xargs -J % cp % ${FPM_BIN1}
# build patched fpm (stage2) using the patched fpm (stage1)
ln -fhs ${WRKBUILD}/stage2 ${WRKSRC}/build
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
"${FPM_BIN1}" build \
--profile release \
--verbose
do-install:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${FPM_BIN1} run \
--runner "echo" \
--profile release \
| xargs -J % ${INSTALL_PROGRAM} % "${PREFIX}/bin"
do-test:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${FPM_BIN1} test \
--profile release \
--verbose
.include <bsd.port.mk>

8
devel/fpm/distinfo Normal file
View file

@ -0,0 +1,8 @@
SHA256 (M_CLI2-90a1a146.tar.gz) = oDHnw7+UxlItLTC2t7160qjZ+a21aOn8e1m09XFrODM=
SHA256 (fpm-0.7.0.F90) = 0W5FtwUCnW04sLp8zKsrnttIwvKUQUc1SLhm2gOJJD4=
SHA256 (fpm-0.7.0.tar.gz) = nXaZD90HB9MJcpFh9ThwN3f6HP8X+KncWWzuhGUp4k8=
SHA256 (toml-f-e49f5523.tar.gz) = 2m9bhp5VnKEt4bQPGoWj9f8IDy5I8xaHVINHesw+ERo=
SIZE (M_CLI2-90a1a146.tar.gz) = 13771712
SIZE (fpm-0.7.0.F90) = 985847
SIZE (fpm-0.7.0.tar.gz) = 169412
SIZE (toml-f-e49f5523.tar.gz) = 94071

View file

@ -0,0 +1,20 @@
- use vendored dependencies
Index: fpm.toml
--- fpm.toml.orig
+++ fpm.toml
@@ -7,12 +7,10 @@ copyright = "2020 fpm contributors"
[dependencies]
[dependencies.toml-f]
-git = "https://github.com/toml-f/toml-f"
-rev = "e49f5523e4ee67db6628618864504448fb8c8939"
+path = "vendor/toml-f"
[dependencies.M_CLI2]
-git = "https://github.com/urbanjost/M_CLI2.git"
-rev = "ea6bbffc1c2fb0885e994d37ccf0029c99b19f24"
+path = "vendor/M_CLI2"
[[test]]
name = "cli-test"

View file

@ -0,0 +1,23 @@
- use egfortran by default
Index: src/fpm_command_line.f90
--- src/fpm_command_line.f90.orig
+++ src/fpm_command_line.f90
@@ -144,7 +144,7 @@ character(len=80), parameter :: help_text_build_common
]
! '12345678901234567890123456789012345678901234567890123456789012345678901234567890',&
character(len=80), parameter :: help_text_compiler(*) = [character(len=80) :: &
- ' --compiler NAME Specify a compiler name. The default is "gfortran" ',&
+ ' --compiler NAME Specify a compiler name. The default is "egfortran" ',&
' unless set by the environment variable FPM_FC. ',&
' --c-compiler NAME Specify the C compiler name. Automatically determined by ',&
' default unless set by the environment variable FPM_CC. ',&
@@ -203,7 +203,7 @@ contains
character(len=*), parameter :: fc_env = "FC", cc_env = "CC", ar_env = "AR", &
& fflags_env = "FFLAGS", cflags_env = "CFLAGS", cxxflags_env = "CXXFLAGS", ldflags_env = "LDFLAGS", &
- & fc_default = "gfortran", cc_default = " ", ar_default = " ", flags_default = " ", &
+ & fc_default = "egfortran", cc_default = " ", ar_default = " ", flags_default = " ", &
& cxx_env = "CXX", cxx_default = " "
type(error_t), allocatable :: error

View file

@ -0,0 +1,108 @@
- use default compiler (fortran, C, C++) for OpenBSD
- prefer -O2 as default optimization flag
Index: src/fpm_compiler.f90
--- src/fpm_compiler.f90.orig
+++ src/fpm_compiler.f90
@@ -51,6 +51,7 @@ enum, bind(C)
enumerator :: &
id_unknown, &
id_gcc, &
+ id_cc_openbsd, &
id_f95, &
id_caf, &
id_intel_classic_nix, &
@@ -135,6 +136,7 @@ character(*), parameter :: &
flag_gnu_coarray = " -fcoarray=single", &
flag_gnu_backtrace = " -fbacktrace", &
flag_gnu_opt = " -O3 -funroll-loops", &
+ flag_openbsd_opt = " -O2 -funroll-loops", &
flag_gnu_debug = " -g", &
flag_gnu_pic = " -fPIC", &
flag_gnu_warn = " -Wall -Wextra -Wimplicit-interface", &
@@ -227,6 +229,14 @@ subroutine get_release_compile_flags(id, flags)
flag_gnu_limit//&
flag_gnu_coarray
+ case(id_cc_openbsd)
+ flags = &
+ flag_openbsd_opt//&
+ flag_gnu_external//&
+ flag_gnu_pic//&
+ flag_gnu_limit//&
+ flag_gnu_coarray
+
case(id_f95)
flags = &
flag_gnu_opt//&
@@ -315,7 +325,7 @@ subroutine get_debug_compile_flags(id, flags)
flag_gnu_debug//&
flag_gnu_check//&
flag_gnu_backtrace
- case(id_gcc)
+ case(id_gcc, id_cc_openbsd)
flags = &
flag_gnu_warn//&
flag_gnu_pic//&
@@ -403,7 +413,7 @@ pure subroutine set_cpp_preprocessor_flags(id, flags)
select case(id)
case default
flag_cpp_preprocessor = ""
- case(id_caf, id_gcc, id_f95, id_nvhpc)
+ case(id_caf, id_gcc, id_cc_openbsd, id_f95, id_nvhpc)
flag_cpp_preprocessor = "-cpp"
case(id_intel_classic_windows, id_intel_llvm_windows)
flag_cpp_preprocessor = "/fpp"
@@ -500,7 +510,7 @@ function get_include_flag(self, path) result(flags)
& id_flang, id_flang_new, id_f18, &
& id_intel_classic_nix, id_intel_classic_mac, &
& id_intel_llvm_nix, id_lahey, id_nag, id_ibmxl, &
- & id_lfortran)
+ & id_lfortran, id_cc_openbsd)
flags = "-I "//path
case(id_intel_classic_windows, id_intel_llvm_windows)
@@ -518,7 +528,7 @@ function get_module_flag(self, path) result(flags)
case default
flags = "-module "//path
- case(id_caf, id_gcc, id_f95, id_cray, id_lfortran)
+ case(id_caf, id_gcc, id_f95, id_cray, id_lfortran, id_cc_openbsd)
flags = "-J "//path
case(id_nvhpc, id_pgi, id_flang)
@@ -569,7 +579,7 @@ subroutine get_default_c_compiler(f_compiler, c_compil
case(id_ibmxl)
c_compiler='xlc'
- case(id_lfortran)
+ case(id_lfortran, id_cc_openbsd)
c_compiler = 'cc'
case(id_gcc)
@@ -607,6 +617,9 @@ subroutine get_default_cxx_compiler(f_compiler, cxx_co
case(id_lfortran)
cxx_compiler = 'cc'
+ case(id_cc_openbsd)
+ cxx_compiler = 'c++'
+
case(id_gcc)
cxx_compiler = 'g++'
@@ -659,8 +672,13 @@ function get_id(compiler) result(id)
integer :: stat
- if (check_compiler(compiler, "gfortran")) then
- id = id_gcc
+ if (check_compiler(compiler, "gfortran") .or. check_compiler(compiler, "egfortran")) then
+ select case (get_os_type())
+ case default
+ id = id_gcc
+ case(OS_OPENBSD)
+ id = id_cc_openbsd
+ end select
return
end if

View file

@ -0,0 +1,17 @@
- default to OpenBSD detection (still overridable with OSTYPE env)
Index: src/fpm_environment.f90
--- src/fpm_environment.f90.orig
+++ src/fpm_environment.f90
@@ -114,6 +114,11 @@ contains
end if
end if
+ ! We are in ports tree, it is OpenBSD
+ r = OS_OPENBSD
+ ret = r
+ return
+
! Linux
inquire (file='/etc/os-release', exist=file_exists)

View file

@ -0,0 +1,45 @@
- add specific profiles 'egfortran' and 'gfortran' for OpenBSD
Index: src/fpm/manifest/profiles.f90
--- src/fpm/manifest/profiles.f90.orig
+++ src/fpm/manifest/profiles.f90
@@ -171,7 +171,8 @@ module fpm_manifest_profile
logical, intent(out) :: is_valid
select case(compiler_name)
case("gfortran", "ifort", "ifx", "pgfortran", "nvfortran", "flang", "caf", &
- & "f95", "lfortran", "lfc", "nagfor", "crayftn", "xlf90", "ftn95")
+ & "f95", "lfortran", "lfc", "nagfor", "crayftn", "xlf90", &
+ & "ftn95", "egfortran")
is_valid = .true.
case default
is_valid = .false.
@@ -674,6 +675,16 @@ module fpm_manifest_profile
default_profiles = [ &
& new_profile('release', &
+ & 'egfortran', &
+ & OS_OPENBSD, &
+ & flags=' -O2 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops', &
+ & is_built_in=.true.), &
+ & new_profile('release', &
+ & 'gfortran', &
+ & OS_OPENBSD, &
+ & flags=' -O2 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops', &
+ & is_built_in=.true.), &
+ & new_profile('release', &
& 'caf', &
& OS_ALL, &
& flags=' -O3 -Wimplicit-interface -fPIC -fmax-errors=1 -funroll-loops', &
@@ -726,6 +737,12 @@ module fpm_manifest_profile
&'lfortran', &
& OS_ALL, &
& flags = ' flag_lfortran_opt', &
+ & is_built_in=.true.), &
+ & new_profile('debug', &
+ & 'egfortran', &
+ & OS_OPENBSD, &
+ & flags = ' -Wall -Wextra -Wimplicit-interface -fPIC -fmax-errors=1 -g -fcheck=bounds&
+ & -fcheck=array-temps -fbacktrace -fcoarray=single', &
& is_built_in=.true.), &
& new_profile('debug', &
& 'caf', &

20
devel/fpm/pkg/DESCR Normal file
View file

@ -0,0 +1,20 @@
Fortran Package Manager (fpm) is a package manager and build system for Fortran.
Its key goal is to improve the user experience of Fortran programmers. It does
so by making it easier to build your Fortran program or library, run the
executables, tests, and examples, and distribute it as a dependency to other
Fortran projects. Fpm's user interface is modeled after Rust's Cargo, so if
you're familiar with that tool, you will feel at home with fpm. Fpm's long term
vision is to nurture and grow the ecosystem of modern Fortran applications and
libraries.
Fpm is an early prototype and is evolving rapidly. You can use it to build and
package your Fortran projects, as well as to use existing fpm packages as
dependencies. Fpm's behavior and user interface may change as it evolves,
however as fpm matures and we enter production, we will aim to stay backwards
compatible. Please follow the issues to contribute and/or stay up to date with
the development. Before opening a bug report or a feature suggestion, please
read our Contributor Guide. You can also discuss your ideas and queries with the
community in fpm discussions, or more broadly on Fortran-Lang Discourse.
Fortran Package Manager is not to be confused with Jordan Sissel's fpm, a more
general, non-Fortran related package manager.

1
devel/fpm/pkg/PLIST Normal file
View file

@ -0,0 +1 @@
@bin bin/fpm