Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmupdf initial port #1950

Merged
merged 2 commits into from
Dec 21, 2017
Merged

libmupdf initial port #1950

merged 2 commits into from
Dec 21, 2017

Conversation

glachancecmaisonneuve
Copy link
Contributor

@glachancecmaisonneuve glachancecmaisonneuve commented Oct 10, 2017

-For some reason the linting process kept nagging at me until I set both VCPKG_LIBRARY_LINKAGE and VCPKG_CRT_LINKAGE to static.
-While creating the port, I saw that sumatrapdf actually builds a non-static version of this library. The source provided by libmupdf.org are all geared towards a static build. The non-static sumatrapdf build of libmupdf seems pretty intricate and involves a custom module-definition file for the linker and something I don't quite grasp yet having to do with a resource file. I guess what I'm asking is "how hard should I try to provide a non-static build" for this port?

@ras0219-msft
Copy link
Contributor

ras0219-msft commented Oct 12, 2017

Thanks for the PR!

If the upstream sources seem totally incompatible with a non-static build, then it's fine to simply force the library linkage to static. However, I am somewhat concerned about the linting issue; generally portfiles shouldn't be switching the CRT linkage because it will likely result in unusable binaries.

Since you're providing a replacement buildsystem anyway (the vcxproj), it would be far shorter and cleaner to use CMake. Here are a few examples to show how easy that is to do: [1] [2] [3].

[1] https://github.com/Microsoft/vcpkg/blob/790c3777b7eaf3c8d1894abc2694038e2858141d/ports/speexdsp/CMakeLists.txt
[2] https://github.com/Microsoft/vcpkg/blob/81bb33dc3ee677d4167e0480d1f2d522756e7f24/ports/pqp/CMakeLists.txt
[3] https://github.com/Microsoft/vcpkg/blob/319dd85ebcb248dce51c4e8ea9c94e6e6bdd4d4c/ports/libstemmer/CMakeLists.txt

@glachancecmaisonneuve
Copy link
Contributor Author

glachancecmaisonneuve commented Oct 25, 2017

Since you're providing a replacement buildsystem anyway (the vcxproj)

I get that vcxproj at very little cost, by running vcupgrade (or devenv /upgrade) on the provided project, made-for-older-msbuild vcproj. I would script it rather than provide the upgraded project manually I could find a reliable way to do so. Even better would be the ability to force msbuild to build the older vcproj project files but no combination of switches have ever allowed me to do so without first upgrading to vcXproj project file first (this last statement can get confusing since the vcproj extension was recently recycled. I am referring to project files created under visual studio 10 or under).

generally portfiles shouldn't be switching the CRT linkage because it will likely result in unusable binaries

Let me double check on that one.

@glachancecmaisonneuve
Copy link
Contributor Author

About having to set VCPKG_CRT_LINKAGE:

  • What I wrote needs some clarification: I only get linting problems when vcpkg expects a dynamic library but I provide a static one instead of failing. For example the command vcpkg install libmupdf:x64-windows should fail, however it does not by virtue of the port file adjusting the build to static (set VCPKG_LIBRARY_LINKAGE static).
  • Asking for (and getting) a static build works without linting issues every time. vcpkg install libmupdf:x64-windows-static
  • The resulting packages vcpkg/packages/libmupdf-x64-static and vcpkg/packages/libmupdf-x64 folders and byte-to-byte compare identical.

If I only set VCPKG_LIBRARY_LINKAGE static, the linting process complains that it

Expected Debug,Dynamic crt linkage but [...] got [...] Debug,Static

To me the linking process is as close as you can get to real magic. Any advice on how to proceed further?

@slyshykO
Copy link

@glachancecmaisonneuve
Copy link
Contributor Author

I won't make any further modifications on this pull request because I don't have the expertise to maintain a cmake build system for this (or any) library. I also didn't want to close the branch because that would likely mean losing what Robert commited.

@ras0219-msft ras0219-msft merged commit 4e6678b into microsoft:master Dec 21, 2017
@ras0219-msft
Copy link
Contributor

Thanks!

ras0219-msft pushed a commit that referenced this pull request Jan 3, 2018
* [vcpkg] Further fix for clang/gcc

* [vcpkg] Only default target triplet to windows if on windows

* [mpfr] add MPFR_USE_INTMAX_T

* [mpfr] prepend stdint to header

* [mpfr] fix portfile

* [mpfr] fix source path

* [mpfr] define have_stdint_h

* [mpfr] revert portfile patch

* [mpfr] prefer ninja

* [mpfr] bump version

* Updated benchmark to v1.3

* [libmspack] Initial port.

* [vcpkg] Add --x-xunit internal command to print installation results in a VSTS friendly format.

* [many ports] Updates to latest

* [llvm] Fail early on UWP

* [netcdf-c] Fix x64-windows-static builds

* [harfbuzz] Revert upgrade due to regression

* Exit early if no VS is found

* [libsodium] Fix static build trying to copy dlls

* Specify VSLANG=1033 to use english locale in builds

Resolves several locale-specific issues outside our control

* Exclude and warn about VS instances without English language pack

Resolves several locale-specific issues outside our control

* [botan] Revert upgrade due to regressions

* [vlpp] initial create

* [vlpp] add the CppMerge.exe tool

* libuv: update to v1.18.0

* [hotfix] Remove VSLANG=1033. It is causing a lot of Process creation failed with error code: 87

* Properly fix VSLANG=1033

* [vcpkg-contact-survey] Add monthly survey prompt

* Update libtorrent to 1.1.5

* [speex] Fix debug mode .def file. Add exports for extern globals.

* [scintilla] Initial port.

* Flint: enable DLL builds (#2271)

* [flint] enable dynamic building

* [flint] increment version

* [sciter] Update to 4.0.6.5590

* Add `vcpkg integrate powershell` for tab completion

* [autocomplete] Add info in README.md

* [aws-sdk-cpp] update to 1.3.15

* Update CHANGELOG and bump version to v0.0.100

* Adding re2 port

* [re2] Use vcpkg_from_github()

* [re2] Don't pass BUILD_SHARED_LIBS

BUILD_SHARED_LIBS should not be locked to shared/static, because the other type will fail.
Vcpkg was overriding this flag before, so no behavior change. (i.e. static builds worked before as well).
Also tests = OFF.

* crow initial port

* fcl: add missing dependencies within cmake

Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>

* Fix pcl/CMakeLists fot Visual Studio 2017

Fix conditional branch for Visual C++ 2017.
Visual C++ 2017 has a version number 191x.

* [vcpkg-msbuild-integration] Address #2299 by using full path to powershell.

* Fix path to powershell.exe

#2299

* Improve error message when failing to parse package

* [ms-gsl] update to 2017-12-04

* [ms-gsl] simplify portfile

* Adaptation for so-5.5.20-beta1

* Improve error message on invalid dependency of package

* [libsodium] Disable tests

Also, this is a workaround for x64-windows-static taking forever in VS2017 15.5

* updata live555 live555-latest

* [gmime] Update to version 3.0.5.

* curl: update to v7.57.0

Due to changes in curl's CMake support, where it now installs .cmake
files, we now have to make sure that they are installed into the correct
directory (and not duplicated into the debug/share/ directory, either).

Also, a change in the context of the 2nd patch required an update of
said patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* [live555] Set version instead of latest and update CONTROL file

* openssl: update to v1.0.2n

The patch to allow for spaces in paths while running the Perl helpers is
no longer necessary, and was dropped.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

* [ACE] 6.4.6

* Update for sobjectizer v.5.5.20

* [jansson] Prefer ninja

* [openssl] Remove entry of removed patch

* [unicorn] Adding unicorn port

* Improve vcpkgExtractFile. Also merge vcpkgRemoveDirectory/File

* [vcpkg-cmake-toolchain]

Use list(APPEND) instead of set(). Fixes #2336.
Fix MPI issue introduced in cmake 3.10. Fixes #2317.
Add _VCPKG_ROOT_DIR to persisted variables to reduce disk access during cmake reconfigure.

* [gtest] Remove renaming of DLLs -- only the import libs need renaming.

* [unicorn] Adjust handling of CRT and LIBRARY LINKAGE. Reformat to LF.

* [mbedtls] Initial port. (#2286)

* mbedtls: init port

* add VCPKG_LIBRARY_LINKAGE for static libs only

* [mbedtls] Slight cleanup

* [tinyexif] add TinyEXIF library (#2221)

* alac-decoder (#2176)

* [tinyexif] update to version 1.0.1

* [speex] Fix regression for release mode import library

* [speex] Fix release mode .def file. Add missing exports (#2340)

* [speex] Fix release mode .def file. Add missing exports
Fixed .def file in release mode (it is bugged after #2293 fix in d5395ac) #2293 (comment)
Added exports for speex_header_free and speex_mode_list (#2292 (comment))

* [speex] Fix regression for release mode import library

* [vcpkg-cmake-toolchain] Mark _VCPKG_ROOT_DIR as INTERNAL

* [openssl] Add -utf-8 flag

* [exiv2] update to latest master and fix debug config

* Fix Gtest port fails install when one of the configuration is set to VCPKG_BUILD_TYPE (#2359)

* Support build with master/HEAD

Gtest will be able to build with master/HEAD.

* Fix install when one of the configuration is set to VCPKG_BUILD_TYPE

Fix install when one of the configuration is set to VCPKG_BUILD_TYPE.

* [powershell] Use \ instead of / for paths. Resolves #2358. Resolves #2361

* Fix fetching dependency text

* [vcpkg-upgrade] Initial commit of upgrade command.

* [vcpkg-upgrade] Accept list of packages to specifically upgrade.

* Upgrade assimp to v4.1.0 (#2364)

* [assimp] Update to v4.1.0 and remove code patch which is fixed in new version

* [assimp] Fix vcpkg_fixup_cmake_targets argument

* [assimp] Fix formatting

* Revert "[vcpkg-upgrade] Accept list of packages to specifically upgrade."

This reverts commit d88563c.

* Revert "[vcpkg-upgrade] Initial commit of upgrade command."

This reverts commit 803347a.

* [vcpkg] Fix regressions introduced with update command. Fixed issue with upgrade where it assumed downloads were not allowed.

* [brotli] Fix regressions introduced during update

* Add quotation marks to support user profiles with spaces in them

* Revert "Add quotation marks to support user profiles with spaces in them"

This reverts commit 0ba4b66.

* [vcpkg] Revert revert of #2369.

* [tinyxml2] update to 6.0.0

* [vcpkg] Fix regressions in WSL build.

* [cpprestsdk] Update to 2.10.1

* [gtest] Fix issue with renaming gtest DLLs in debug mode

* Added port brynet - A C++ cross platform high performance TCP network library using C++ 11.

* [tbb] Update to 2018_U2

* [gsl-lite] Updated to 0.26.0

* [nlohmann-json] Update to 3.0.0

* Update string-theory to 1.7

* Update Range-V3-VS2015.

* [vcpkg] Improve error message upon graph cycle detected.

* [glm] Ignore MSVC warning C4201

* [boost] Modularize

* [vcpkg-list] Improve list output for long triplets

* Update downstream libraries to use modularized boost

* [magnum] Remove --trace

* [vcpkg-list] Improve list output for long triplets

* [llvm] Add atlmfc to dependencies -- fixes #2400

* [vcpkg-integrate-powershell] Fix $false bug. Fixes #2397.

* Fix find Boost when can not be found Boost that installed with Vcpkg (#2395)

* Fix find Boost when can not be found Boost that installed with Vcpkg

Fix find Boost when can not be found Boost that installed with Vcpkg.
Re-find package Boost uisng user specified options.

* Fix regex of generators

Fix regex of generators.
Add ending position.

* Fix Save and Resore Boost_COMPILER

* [vcpkg-cmake-integration] Expand saved boost variables

* [sciter] Update to 4.0.7.5637

* Initial experimental re-support for VCPKG_BUILD_TYPE release

re-add this commit 5335d17

* [dlib] update to 19.8

* [fftw] Build more libs

* Improving support for ITK

* [libdatrie] add version 0.2.10

* [alembic] update to 1.7.5

* Added port libqrencode - a fast and compact QR Code encoding library (#2372)

* #2363

* libqrencode: Added necessary new line at end of CONTROL, portfile.cmake, usage files. Added copying the usage file in portfile.cmake, and removed unnecessary DBUILD_SHARED_LIBS as remarked @ras0219-msft

* [libqrencode] Adjust usage to match other packages

* libmupdf initial port (#1950)

* libmupdf initial port

* [libmupdf] Use CMake for buildsystem replacement.

* [hpx] Handle boost breaking changes. Fixes #2416.

* [folly] Handle boost upgrade

* [nghttp2] initial port (dynamic build only). (#2366)

* [nghttp2] initial port (dynamic build only).

* [nghttp2] Slight tweak

* [brynet] Use vcpkg_from_github

* [boost] Fix uwp builds on systems with spaces

* [assimp] Fix unitialized variable issue.

* [libtorrent] Update to more recent snapshot to support boost 1.66

* [assimp] Fixup: add missing patchfile

* [vcpkg-download-distfile] Add input sanitization

* [boost-python] Fix build.

* [qt5] Add atlmfc to dependencies on windows due to �tlbase.h inclusion. Fixes #2344.

* clang-tidy fixes

* [opencv] update to 3.4.0

* [vcpkg-hash] Replace certutil.exe with cmake built-in hash commands

* [sciter] Update to 4.0.8.5649

* [directxmesh] Update to the last version (dec2017)

* [directxtex] Update to the last version (dec2017)

* [directxtk] Update to the last version (dec2017)

* Revert "clang-tidy fixes"

This reverts commit 2d0a763.

* [libgit2] Initial port.

* [bullet3] Update from 2.86.1 to 2.87

* Update librealsense v2.8.3

Update librealsense v2.8.3.

* [libconfig] update to 1.7.1

* [fmt] update to 4.1.0

* [gainput] Initial port

* mpfr: fix download link

* [mpir] use vcpkg_from_github

* [portmidi] Initial port

* [jack2] Initial commit

* [libdatrie] fix trietool for MSVC runtime

* Fix version

* Add support for Box2D to be build as a static library

* [asio] swith to vcpkg_from_github()

* [nlohmann-json] update to 3.0.1

* [libbson] update to 1.9.0

* [mongo-c-driver] update to 1.9.0

* [harfbuzz] update to 1.7.4

* [jack2] Prefer using vcpkg_from_github. Removed check for Windows Store

* [zstd] update to 1.3.3

* Use vcpkg version of BLAS and LAPACK in dlib
dlib v19.8 detects these packages correctly

* [libpqxx] Initial port

* [tacopie] Update to 3.2.0

* [cpp-redis] Update to 4.3.0

* Update cmake to 3.10.1

* Remove workaround for a bug in FindMPI.cmake that was introduced in cmake 3.10.0 and fixed in 3.10.1

* Update szip to 2.1.1

* Update HDF5 to 1.10.1

* [soundtouch] Initial port (#2455)

* [soundtouch] Initial port

* [soundtouch] Fixed typo

* [vcpkg-download-distfile] Fix #2426

* Add preliminary support for arm-windows and arm64-windows triplets (#2371)

* Add preliminary support for arm-windows and arm64-windows triplets

Visual Studio 15.4 shipped with new VC tools targeting arm and arm64
for desktop. This change allows for recognition and usage of new
triplets supporting arm and arm64 Windows desktop and server targets.

* Remove unnecessary changes

* Part 2

* Part 3

* Make detection of Arm64 _VCPKG_TARGET_ARCHITECTURE precise

* Enforce usage of Visual Studio CMake generatorfor arm and temporarily arm64 targets

* Address code review feedback, clean libjpeg-turbo port.cmake

* [libjpeg-turbo][tiff] Reduce changes to existing libraries.

* [vcpkg-cmake] Simplify toolchain selection logic and improve comments

* [gitignore] Add new triplets to gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants