Skip to content

Commit

Permalink
Add windows for krb5
Browse files Browse the repository at this point in the history
  • Loading branch information
talregev committed May 12, 2024
1 parent a1212c9 commit 7bb2b76
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 25 deletions.
35 changes: 35 additions & 0 deletions ports/krb5/fix_relative_path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/src/build-tools/krb5-config.in b/src/build-tools/krb5-config.in
index 8e6eb8660..89a401dab 100755
--- a/src/build-tools/krb5-config.in
+++ b/src/build-tools/krb5-config.in
@@ -27,7 +27,7 @@
# Configurable parameters set by autoconf
version_string="Kerberos 5 release @KRB5_VERSION@"

-prefix=@prefix@
+prefix='$(pwd)/../../../'
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
@@ -39,7 +39,7 @@ PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
DL_LIB='@DL_LIB@'
DEFCCNAME='@DEFCCNAME@'
DEFKTNAME='@DEFKTNAME@'
-DEFCKTNAME='@DEFCKTNAME@'
+DEFCKTNAME='$(pwd)/../../../var/krb5/user/%{euid}/client.keytab'

LIBS='@LIBS@'
GEN_LIB=@GEN_LIB@
diff --git a/src/util/et/compile_et.sh b/src/util/et/compile_et.sh
index f17ddba71..6a98a8bab 100755
--- a/src/util/et/compile_et.sh
+++ b/src/util/et/compile_et.sh
@@ -2,7 +2,7 @@
#
#
AWK=@AWK@
-DIR=@DIR@
+DIR='$(pwd)/../../../share/et'

usage="usage: $0 [ -d scriptDir ] [ --textdomain domain [ --localedir dir ] ]"
usage="$usage inputfile.et"
92 changes: 69 additions & 23 deletions ports/krb5/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,75 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://kerberos.org/dist/krb5/1.21/krb5-${VERSION}.tar.gz"
FILENAME "krb5-${VERSION}.tar.gz"
SHA512 4e09296b412383d53872661718dbfaa90201e0d85f69db48e57a8d4bd73c95a90c7ec7b6f0f325f6bc967f8d203b256b071c0191facf080aca0e2caec5d0ac49
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO krb5/krb5
REF krb5-${VERSION}-final
SHA512 184ef8645d7e17f30a8e3d4005364424d2095b3d0c96f26ecef0c2dd2f3a096a0dd40558ed113121483717e44f6af41e71be0e5e079c76a205535d0c11a2ea34
HEAD_REF master
PATCHES
fix_relative_path.patch
)

vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE ${ARCHIVE}
)

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}/src"
AUTOCONFIG
OPTIONS
"CFLAGS=-fcommon \$CFLAGS"
)

vcpkg_install_make()
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES)
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_PATH}")
vcpkg_build_nmake(
SOURCE_PATH "${SOURCE_PATH}/src"
PROJECT_NAME Makefile.in
TARGET prep-windows
)
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/ DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug")
vcpkg_install_nmake(
SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}"
PROJECT_NAME "Makefile"
OPTIONS
"NO_LEASH=1"
OPTIONS_RELEASE
"KRB_INSTALL_DIR=${CURRENT_PACKAGES_DIR}"
OPTIONS_DEBUG
"KRB_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug"
)
set(tools
ccapiserver
gss-client
gss-server
kcpytkt
kdeltkt
kdestroy
kfwcpcc
kinit
klist
kpasswd
kswitch
kvno
mit2ms
ms2mit
)
vcpkg_copy_tools(
SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin"
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin"
TOOL_NAMES ${tools}
AUTO_CLEAN
)
foreach(tool_name ${tools})
list(APPEND debug_tools_to_remove "${CURRENT_PACKAGES_DIR}/debug/bin/${tool_name}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
endforeach()
file(REMOVE ${debug_tools_to_remove})
else()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}/src"
AUTOCONFIG
OPTIONS
"CFLAGS=-fcommon \$CFLAGS"
)
vcpkg_install_make()
endif()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat1")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat5")
Expand All @@ -29,9 +80,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/krb5/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/var")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/var")

# remove due to absolute path error
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/compile_et")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/krb5-config")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/debug/")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/copyright.rst")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/NOTICE")
3 changes: 2 additions & 1 deletion ports/krb5/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "krb5",
"version": "1.21.2",
"port-version": 1,
"description": "Network authentication protocol",
"homepage": "https://web.mit.edu/kerberos/",
"license": "MIT",
"supports": "linux"
"supports": "x64 & (linux | (!static & !uwp & windows))"
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4050,7 +4050,7 @@
},
"krb5": {
"baseline": "1.21.2",
"port-version": 0
"port-version": 1
},
"ktx": {
"baseline": "4.3.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/k-/krb5.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ed5bab9233f7c190c2b7c347c94535c0794ea275",
"version": "1.21.2",
"port-version": 1
},
{
"git-tree": "287bac02bb53283b043688050edd9d02e0b039c7",
"version": "1.21.2",
Expand Down

0 comments on commit 7bb2b76

Please sign in to comment.