Skip to content

Commit

Permalink
Fix qtwebengine
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann-A committed May 6, 2024
1 parent bceeca6 commit 20a110d
Show file tree
Hide file tree
Showing 14 changed files with 371 additions and 76 deletions.
48 changes: 48 additions & 0 deletions ports/cups/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OpenPrinting/cups
REF "v${VERSION}"
SHA512 9def5d66ff000fa36cc00749c9e3533348f55fa34724bab9fe8d982db990003c499b4acf2c8ae81d30a0c0ffded39b51f36eb391ab06a1da79bbe7d28a270cc8
HEAD_REF master
)

file(REMOVE "${SOURCE_PATH}/configure.ac")
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
COPY_SOURCE
)

#vcpkg_build_make(BUILD_TARGET depend LOGFILE_ROOT depend)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()

#TODO: Check some full install path defines from the configure log an how they are used in the code.

set(cups-config-file "${CURRENT_PACKAGES_DIR}/tools/cups/bin/cups-config")
file(READ "${cups-config-file}" cups-config)
string(REPLACE
[[#!/bin/sh]]
[[#!/bin/sh
vcpkg_prefix=$( realpath "$0" ) && dirname "$vcpkg_prefix"]]
cups-config "${cups-config}")
string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${vcpkg_prefix}/../../..]] cups-config "${cups-config}")
file(WRITE "${cups-config-file}" "${cups-config}")

vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/etc/cups/cupsd.conf" "${CURRENT_INSTALLED_DIR}" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/etc/cups/cups-files.conf" "${CURRENT_INSTALLED_DIR}" "")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/etc/cups/ppd"
"${CURRENT_PACKAGES_DIR}/etc/cups/ssl"
"${CURRENT_PACKAGES_DIR}/lib/cups/driver"
"${CURRENT_PACKAGES_DIR}/share/cups/cups/data"
"${CURRENT_PACKAGES_DIR}/share/cups/cups/model"
"${CURRENT_PACKAGES_DIR}/share/cups/cups/banners"
"${CURRENT_PACKAGES_DIR}/share/cups/cups/profiles"
"${CURRENT_PACKAGES_DIR}/var"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
11 changes: 11 additions & 0 deletions ports/cups/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "cups",
"version": "2.4.8",
"description": "OpenPrinting CUPS Sources",
"homepage": "https://openprinting.github.io/cups/cups3.html",
"license": "Apache-2.0",
"supports": "!windows",
"dependencies": [
"openssl"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index cd7b0d941c..b4a6dce885 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1010,7 +1010,11 @@ struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
attribute_deprecated
int64_t av_stream_get_end_pts(const AVStream *st);
#endif

+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st);
+// Chromium: We use the internal field first_dts ^^^
+
#define AV_PROGRAM_RUNNING 1

/**
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index de7580c32d..0ef0fe530e 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -33,7 +33,14 @@ int64_t av_stream_get_end_pts(const AVStream *st)
return AV_NOPTS_VALUE;
}
#endif

+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st)
+{
+ return cffstream(st)->first_dts;
+}
+// Chromium: We use the internal field first_dts ^^^
+
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
int std_compliance)
{
1 change: 1 addition & 0 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ vcpkg_from_github(
0015-Fix-xml2-detection.patch
0020-fix-aarch64-libswscale.patch
0022-fix-iconv.patch
040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch
)

if(SOURCE_PATH MATCHES " ")
Expand Down
75 changes: 39 additions & 36 deletions ports/nspr/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ vcpkg_extract_source_archive(
SOURCE_BASE "${VERSION}"
)

set(MOZBUILD_ROOT "${CURRENT_HOST_INSTALLED_DIR}/tools/mozbuild")
set(OPTIONS "")

set(MOZBUILD_BINDIR "${MOZBUILD_ROOT}/bin")
vcpkg_add_to_path("${MOZBUILD_BINDIR}")
if(VCPKG_TARGET_IS_WINDOWS)
set(MOZBUILD_ROOT "${CURRENT_HOST_INSTALLED_DIR}/tools/mozbuild")

set(MOZBUILD_MSYS_ROOT "${MOZBUILD_ROOT}/msys")
vcpkg_add_to_path(PREPEND "${MOZBUILD_MSYS_ROOT}")
set(MOZBUILD_BINDIR "${MOZBUILD_ROOT}/bin")
vcpkg_add_to_path("${MOZBUILD_BINDIR}")

set(MOZBUILD_MSYS_ROOT "${MOZBUILD_ROOT}/msys")
vcpkg_add_to_path(PREPEND "${MOZBUILD_MSYS_ROOT}")
list(APPEND OPTIONS "--enable-win32-target=win95")
endif()

set(OPTIONS "")
if (VCPKG_CRT_LINKAGE STREQUAL "dynamic")
list(APPEND OPTIONS "--disable-static-rtl")
else()
list(APPEND OPTIONS "--enable-static-rtl")
endif()

list(APPEND OPTIONS "--enable-win32-target=win95")

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
list(APPEND OPTIONS "--enable-64bit")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
Expand All @@ -46,7 +48,6 @@ set(OPTIONS_RELEASE

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
CONFIGURE_ENVIRONMENT_VARIABLES CC CXX LD
PROJECT_SUBPATH "nspr"
OPTIONS ${OPTIONS}
OPTIONS_DEBUG ${OPTIONS_DEBUG}
Expand All @@ -55,38 +56,40 @@ vcpkg_configure_make(
)
vcpkg_install_make()
vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()
#
# VCPKG FHS adjustments
#

# Release
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(GLOB BIN_RELEASE "${CURRENT_PACKAGES_DIR}/lib/*.dll" "${CURRENT_PACKAGES_DIR}/lib/*.pdb")
list(LENGTH BIN_RELEASE BIN_RELEASE_SIZE)
if (BIN_RELEASE_SIZE GREATER 0)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")

foreach(path ${BIN_RELEASE})
get_filename_component(name "${path}" NAME)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/${name}" "${CURRENT_PACKAGES_DIR}/bin/${name}")
endforeach()
endif()
endif()

# Debug
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(GLOB BIN_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll" "${CURRENT_PACKAGES_DIR}/debug/lib/*.pdb")
list(LENGTH BIN_DEBUG BIN_DEBUG_SIZE)
if (BIN_DEBUG_SIZE GREATER 0)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")

foreach(path IN LISTS BIN_DEBUG)
get_filename_component(name "${path}" NAME)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/${name}" "${CURRENT_PACKAGES_DIR}/debug/bin/${name}")
endforeach()
endif()
if(VCPKG_TARGET_IS_WINDOWS)
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(GLOB BIN_RELEASE "${CURRENT_PACKAGES_DIR}/lib/*.dll" "${CURRENT_PACKAGES_DIR}/lib/*.pdb")
list(LENGTH BIN_RELEASE BIN_RELEASE_SIZE)
if (BIN_RELEASE_SIZE GREATER 0)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")

foreach(path ${BIN_RELEASE})
get_filename_component(name "${path}" NAME)
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/${name}" "${CURRENT_PACKAGES_DIR}/bin/${name}")
endforeach()
endif()
endif()

# Debug
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(GLOB BIN_DEBUG "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll" "${CURRENT_PACKAGES_DIR}/debug/lib/*.pdb")
list(LENGTH BIN_DEBUG BIN_DEBUG_SIZE)
if (BIN_DEBUG_SIZE GREATER 0)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")

foreach(path IN LISTS BIN_DEBUG)
get_filename_component(name "${path}" NAME)
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/${name}" "${CURRENT_PACKAGES_DIR}/debug/bin/${name}")
endforeach()
endif()
endif()
endif()

vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/nspr-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../..")
Expand Down
5 changes: 3 additions & 2 deletions ports/nspr/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
"description": "Netscape portable runtime",
"homepage": "https://releases.mozilla.org/pub/nspr/",
"license": "MPL-2.0",
"supports": "windows & !(arm | uwp | static | xbox)",
"supports": "!(arm | uwp | static | xbox)",
"dependencies": [
{
"name": "vcpkg-tool-mozbuild",
"host": true
"host": true,
"platform": "windows"
}
]
}
11 changes: 11 additions & 0 deletions ports/nss/nss.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}/tools/nss
libdir=${prefix}/lib
includedir=${prefix}/include/nss

Name: NSS
Description: Network Security Services
Version: @VERSION@
Requires: nspr
Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lnssutil3
Cflags: -I${includedir}
69 changes: 43 additions & 26 deletions ports/nss/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,32 @@ if (VCPKG_TARGET_IS_WINDOWS)
execute_process(
COMMAND ${MOZBUILD_BASH} -c pwd
WORKING_DIRECTORY ${CURRENT_INSTALLED_DIR}/lib
OUTPUT_VARIABLE VCPKG_LIBDIR
OUTPUT_VARIABLE VCPKG_LIBDIR_REL
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Using libraries from: ${VCPKG_LIBDIR} arch: ${VCPKG_TARGET_ARCHITECTURE}")
message(STATUS "Using release libraries from: ${VCPKG_LIBDIR_REL} arch: ${VCPKG_TARGET_ARCHITECTURE}")

execute_process(
COMMAND ${MOZBUILD_BASH} -c pwd
WORKING_DIRECTORY ${CURRENT_INSTALLED_DIR}/debug/lib
OUTPUT_VARIABLE VCPKG_LIBDIR_DBG
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Using debug libraries from: ${VCPKG_LIBDIR_DBG} arch: ${VCPKG_TARGET_ARCHITECTURE}")

else()
# TODO: setup non-windows build environment

set(VCPKG_INCLUDEDIR "${CURRENT_INSTALLED_DIR}/include")
set(VCPKG_LIBDIR_DBG "${CURRENT_INSTALLED_DIR}/debug/lib")
set(VCPKG_LIBDIR_REL "${CURRENT_INSTALLED_DIR}/lib")
endif()

# setup gyp-next
set(GYP_NEXT_ROOT "${CURRENT_HOST_INSTALLED_DIR}/tools/gyp-next")
if (VCPKG_HOST_IS_WINDOWS)
find_file(GYP_NEXT NAMES gyp.bat PATHS "${GYP_NEXT_ROOT}" NO_DEFAULT_PATH REQUIRED)
else()
find_program(GYP_NEXT NAMES gyp PATHS "${GYP_NEXT_ROOT}" NO_DEFAULT_PATH REQUIRED)
find_program(GYP_NEXT NAMES gyp REQUIRED)
endif()

vcpkg_add_to_path(PREPEND "${GYP_NEXT_ROOT}")
Expand All @@ -86,9 +96,9 @@ set(OPTIONS
"-v"
"-g"
"--disable-tests"
"--with-nspr=${VCPKG_INCLUDEDIR}/nspr:${VCPKG_LIBDIR}"
"--system-sqlite"
"-Dsign_libs=0"
#"--disable-keylog"
)

if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
Expand Down Expand Up @@ -136,6 +146,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
message(STATUS "Copying sources to debug build dir ...")
file(COPY "${SOURCE_PATH}/nss" DESTINATION "${VCPKG_BINARY_DIR}-dbg")
message(STATUS "Building debug ...")
list(APPEND OPTIONS "--with-nspr=${VCPKG_INCLUDEDIR}/nspr:${VCPKG_LIBDIR_DBG}")
vcpkg_execute_required_process(
COMMAND ${MOZBUILD_ENV} ${GYPENV} bash ./build.sh ${OPTIONS}
WORKING_DIRECTORY ${VCPKG_BINARY_DIR}-dbg/nss
Expand All @@ -148,6 +159,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
message(STATUS "Copying sources to release build dir ...")
file(COPY "${SOURCE_PATH}/nss" DESTINATION "${VCPKG_BINARY_DIR}-rel")
message(STATUS "Building release ...")
list(APPEND OPTIONS "--with-nspr=${VCPKG_INCLUDEDIR}/nspr:${VCPKG_LIBDIR_REL}")
vcpkg_execute_required_process(
COMMAND ${MOZBUILD_ENV} ${GYPENV} bash ./build.sh ${OPTIONS} --opt
WORKING_DIRECTORY ${VCPKG_BINARY_DIR}-rel/nss
Expand Down Expand Up @@ -175,19 +187,17 @@ file(GLOB LIB_RELEASE
"${VCPKG_BINARY_DIR}-rel/dist/Release/lib/*.dll"
"${VCPKG_BINARY_DIR}-rel/dist/Release/lib/*.pdb"
)
list(LENGTH LIB_RELEASE LIB_RELEASE_SIZE)

if (LIB_RELEASE_SIZE GREATER 0)
if (LIB_RELEASE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
endif()
foreach(path ${LIB_RELEASE})
get_filename_component(name "${path}" NAME)
file(RENAME "${path}" "${CURRENT_PACKAGES_DIR}/bin/${name}")
endforeach()

foreach(path ${LIB_RELEASE})
get_filename_component(name "${path}" NAME)
file(RENAME "${path}" "${CURRENT_PACKAGES_DIR}/bin/${name}")
endforeach()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
file(COPY "${VCPKG_BINARY_DIR}-rel/dist/Release/lib" DESTINATION "${CURRENT_PACKAGES_DIR}")

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib")
file(COPY "${VCPKG_BINARY_DIR}-rel/dist/Release/lib" DESTINATION "${CURRENT_PACKAGES_DIR}")
endif()

# Tools from the release build
vcpkg_copy_tools(
Expand Down Expand Up @@ -216,20 +226,27 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
"${VCPKG_BINARY_DIR}-dbg/dist/Debug/lib/*.dll"
"${VCPKG_BINARY_DIR}-dbg/dist/Debug/lib/*.pdb"
)
list(LENGTH LIB_DEBUG LIB_DEBUG_SIZE)

if (LIB_DEBUG_SIZE GREATER 0)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
if(LIB_DEBUG)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

foreach(path ${LIB_DEBUG})
get_filename_component(name "${path}" NAME)
file(RENAME "${path}" "${CURRENT_PACKAGES_DIR}/debug/bin/${name}")
endforeach()

foreach(path ${LIB_DEBUG})
get_filename_component(name "${path}" NAME)
file(RENAME "${path}" "${CURRENT_PACKAGES_DIR}/debug/bin/${name}")
endforeach()
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
file(COPY "${VCPKG_BINARY_DIR}-dbg/dist/Debug/lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug")

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib")
file(COPY "${VCPKG_BINARY_DIR}-dbg/dist/Debug/lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug")
endif()
endif()

file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/")
configure_file("${CMAKE_CURRENT_LIST_DIR}/nss.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/nss.pc" @ONLY)
if(NOT VCPKG_BUILD_TYPE)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/")
configure_file("${CMAKE_CURRENT_LIST_DIR}/nss.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/nss.pc" @ONLY)
endif()
vcpkg_fixup_pkgconfig()
# License
file(INSTALL "${SOURCE_PATH}/nss/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/nss" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/nss/COPYING")
8 changes: 5 additions & 3 deletions ports/nss/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@
"description": "Network Security Services from Mozilla",
"homepage": "https://ftp.mozilla.org/pub/security/nss/releases/",
"license": "MPL-2.0",
"supports": "windows & !arm & !xbox",
"supports": "!arm & !xbox",
"dependencies": [
"nspr",
"sqlite3",
{
"name": "vcpkg-tool-gyp-next",
"host": true
"host": true,
"platform": "windows"
},
{
"name": "vcpkg-tool-mozbuild",
"host": true
"host": true,
"platform": "windows"
}
]
}

0 comments on commit 20a110d

Please sign in to comment.