diff --git a/.devcontainer b/.devcontainer new file mode 160000 index 0000000000..e72d85a627 --- /dev/null +++ b/.devcontainer @@ -0,0 +1 @@ +Subproject commit e72d85a62700eb26748d896466fa2dfa715affc6 diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml new file mode 100644 index 0000000000..169ff5269c --- /dev/null +++ b/.github/workflows/xpbuild.yml @@ -0,0 +1,30 @@ +name: Build +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + workflow_dispatch: +jobs: + linux: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 + with: + cmake-workflow-preset: Linux + runon: ubuntu-latest + secrets: inherit + linux-arm64: + uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 + with: + cmake-workflow-preset: Linux + runon: ubuntu-24.04-arm + secrets: inherit + macos: + uses: externpro/externpro/.github/workflows/build-macos.yml@25.06 + with: + cmake-workflow-preset: Darwin + secrets: inherit + windows: + uses: externpro/externpro/.github/workflows/build-windows.yml@25.06 + with: + cmake-workflow-preset: Windows + secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml new file mode 100644 index 0000000000..146191466e --- /dev/null +++ b/.github/workflows/xprelease.yml @@ -0,0 +1,20 @@ +name: Release +on: + workflow_dispatch: + inputs: + workflow_run_url: + description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)' + required: true + type: string +jobs: + # Upload build artifacts as release assets + release-from-build: + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06 + with: + workflow_run_url: ${{ github.event.inputs.workflow_run_url }} + artifact_pattern: "*.tar.xz" + permissions: + contents: write + id-token: write + attestations: write + secrets: inherit diff --git a/.gitignore b/.gitignore index 3ff5a1f7cd..af7102227b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,7 @@ expat/**/*.sdf expat/**/*.VC.db expat/tests/**/Debug/ expat/tests/**/Release/ +# externpro +.env +_bld*/ +docker-compose.override.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..18932abfb9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".devcontainer"] + path = .devcontainer + url = https://github.com/externpro/externpro diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..9e3eb8fce6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.31) +set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) +project(libexpat) +include(GNUInstallDirs) +include(xpflags) +set(lib expat) +if(DEFINED XP_NAMESPACE) + set(nameSpace NAMESPACE ${XP_NAMESPACE}::) + string(PREPEND lib "${XP_NAMESPACE}::") +endif() +if(NOT DEFINED XP_INSTALL_CMAKEDIR) + set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) +endif() +set(targetsFile ${PROJECT_NAME}-targets) +xpPackageDevel(TARGETS_FILE ${targetsFile} LIBRARIES ${lib}) +add_subdirectory(expat) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000000..f82cfdd2cf --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,8 @@ +{ + "version": 8, + "include": [ + ".devcontainer/cmake/presets/xpLinuxNinja.json", + ".devcontainer/cmake/presets/xpDarwinNinja.json", + ".devcontainer/cmake/presets/xpWindowsVs2022.json" + ] +} diff --git a/CMakePresetsBase.json b/CMakePresetsBase.json new file mode 100644 index 0000000000..acc5c660ac --- /dev/null +++ b/CMakePresetsBase.json @@ -0,0 +1,22 @@ +{ + "version": 8, + "configurePresets": [ + { + "name": "config-base", + "hidden": true, + "binaryDir": "${sourceDir}/_bld-${presetName}", + "cacheVariables": { + "BUILD_doc": "OFF", + "BUILD_shared": "OFF", + "XP_OPT_INSTALL": "OFF", + "XP_NAMESPACE": "xpro" + } + } + ], + "buildPresets": [ + { + "name": "build-base", + "hidden": true + } + ] +} diff --git a/docker-compose.sh b/docker-compose.sh new file mode 120000 index 0000000000..85f182f0be --- /dev/null +++ b/docker-compose.sh @@ -0,0 +1 @@ +.devcontainer/compose.pro.sh \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 120000 index 0000000000..46c1f8918f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1 @@ +.devcontainer/compose.bld.yml \ No newline at end of file diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 0614f85d0d..61da275715 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -1,17 +1,10 @@ # This file is copyrighted under the BSD-license for buildsystem files of KDE # copyright 2010, Patrick Spendrin -cmake_minimum_required(VERSION 2.6...3.31) +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) project(expat) -include(GNUInstallDirs) -include(xpflags) -if(DEFINED XP_NAMESPACE) - set(XP_OPT_INSTALL EXCLUDE_FROM_ALL) - set(nameSpace NAMESPACE ${XP_NAMESPACE}::) -endif() -if(NOT DEFINED XP_INSTALL_CMAKEDIR) - set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) +cmake_minimum_required(VERSION 2.6) endif() set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") set(PACKAGE_NAME "expat") @@ -144,7 +137,6 @@ macro(expat_install) endif() endmacro() -set(targetsFile ${PROJECT_NAME}-targets) expat_install(TARGETS expat EXPORT ${targetsFile} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) @@ -157,7 +149,9 @@ set(includedir "\${prefix}/include") configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc) expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc ${XP_OPT_INSTALL} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +if(XP_OPT_INSTALL) +expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +endif() if(BUILD_tools) set(xmlwf_SRCS @@ -170,10 +164,14 @@ if(BUILD_tools) add_executable(xmlwf ${xmlwf_SRCS}) set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) target_link_libraries(xmlwf expat) - expat_install(TARGETS xmlwf ${XP_OPT_INSTALL} DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(XP_OPT_INSTALL) + expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() if(BUILD_doc) add_custom_command(TARGET expat PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_SOURCE_DIR}/doc/xmlwf.1") - expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" ${XP_OPT_INSTALL} DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1) + if(XP_OPT_INSTALL) + expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1) + endif() endif() endif()