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

Msys2 pkg-config #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Msys2 pkg-config #350

wants to merge 1 commit into from

Conversation

USeebi
Copy link

@USeebi USeebi commented Sep 24, 2016

Msys2 fuse library pkg-config and pacman package to be consumed by makepkg

Msys2 fuse library pkg-config and pacman package to be consumed by
makepkg
@Liryna
Copy link
Member

Liryna commented Sep 24, 2016

Hi @USeebi ,

Thank you for the pull request.

Is it not possible to have a pkg-config that copy all headers in the correct folder from the dokan_fuse project rather than having duplicate headers in the repository ?

(I don't really use pacman/msys2 so if anyone with the knoweldge could help me review this pull request 👍 )

@Rondom
Copy link
Contributor

Rondom commented Sep 25, 2016

Hi @USeebi,
thanks for helping making Dokany better.

pkg-config

Nice to see that you added a pkg-config file! 👍 We actually already had an enhancement request about it: #338
pkg-config is not specific to MSYS2, but actually generic to any platform. Therefore it would be nice to have it available for any platform (MSYS2, Cygwin, Linux (for cross-compilation)) and thus independent of the library and include directories.
Do you think you can integrate the pkg-config into our cmake-build using the instructions in the ticket linked above? You can create a separate Pull-Request for this, to simplify matters.

MSYS2-PKGBUILD:

First of all: Is there a specific reason, why you are submitting this to us and not to @Alexpux/MINGW-packages? I am not particularly opposed to having the PKGBUILD in the Dokany repository, but I would be interested in what your considerations where and why you prefer one over the other option.

I have never done any packaging for MSYS or Arch Linux, so take the following comments with a grain of salt. (I am mostly familiar with Debian packaging and Linux and MSYS2 might differ in several ways I don't know yet about).

As @Liryna has said, you duplicate all header files in the repository. Looking at your packaging, it seems quite manual and I think it can be improved. The way I know it from Debian or RPM-based distros, the package would get built and installed into a separate directory as if you were compiling/installing from source and then a package is created from that.

I have just searched for "cmake" in the MingW-W64-packages repository and the doxygen-package there might be a good example of cmake-based project that is packaged using a PKGBUILD where the source is automatically downloaded, verified using hashes, built and "installed" to be compressed into a package.
Doxygen Mingw-w64 pkgbuild
libssh is another example

Some questions:

  1. Where is the library-file built/installed to in your current implementation?
  2. Why do you install the headers to /opt/? That seems very non-standard to me for packaged software. Why not /usr/include/?

PS: Thanks again for your contribution, it's appreciated.

@USeebi
Copy link
Author

USeebi commented Sep 26, 2016

Hi Rondom,

You're right, the package is manually pulled together after compiling dokan_fuse for makepkg to work with dependency on fuse. I guess the package mostly working with Msys2 as Mingw has no syslog while Linux probably use fuse directly but not dokan-fuse.

The latest Msys2 distribution automatically set /opt/bin in the path so that I put the dokan_fuse library in /opt/bin and fuse include files in /opt/include/dokan_fuse. The installation is automatic with pacman although the package is manual and the /opt directory might be a good place to signify the non-standard.

All these information are coded in fuse.pc and this could be automated with Autotools while there are also PKGBUILD templates with Autotools. I'm not really expert with Autotools and I really need to brush up with Cmake. I guess we need someone expert in both Autotools and Cmake to merge this pull request at will.

@USeebi
Copy link
Author

USeebi commented Oct 1, 2016

An other way to automate is manipulating build.ps1 script

& dokan_fuse/cleancmake.bat
Write-Host "Build Msys2 x64..."
& C:\msys64\msys2_shell.cmd -msys2 -lc "cd '$currentPath'/dokan_fuse/ && cmake . -G 'MSYS Makefiles' && make" | Out-Host
New-Item -Force -Type Directory "pkg/opt/bin/", "pkg/opt/include/", "pkg/usr/lib/pkgconfig/"
Copy-Item "dokan_fuse/fuse.pc" "pkg/usr/lib/pkgconfig/"
Copy-Item "dokan_fuse/.PKGINFO" "pkg/"
Copy-Item "dokan_fuse/libdokanfuse1.dll" "pkg/opt/bin/"
Copy-Item "dokan_fuse/libdokanfuse1.dll.a" "pkg/opt/bin/"
Copy-Item -Recurse "dokan_fuse/include/" "pkg/opt/include/dokan_fuse/"
Remove-Item "dokan_fuse/libdokanfuse1.dll"
Remove-Item "dokan_fuse/libdokanfuse1.dll.a"
& C:\msys64\msys2_shell.cmd -msys2 -lc "cd '$currentPath'/dokan_fuse/pkg && tar -cf - .PKGINFO * | xz -c -z - > ../dokan_fuse-x86_64.pkg.tar.xz"
Write-Host "Build Msys2 x64 - Done" -ForegroundColor Green
Write-Host "Install package with pacman -U dokan_fuse-x86_64.pkg.tar.xz" -ForegroundColor Green

These are the steps that I pulled up the package and I would like to insert the dokany version into the package file name but need more efforts.

@Rondom
Copy link
Contributor

Rondom commented Oct 25, 2016

@USeebi May I ask, why you need an MSYS2-package? As far as I am informed, MSYS2 is a fork of Cygwin and its only purpose is to serve as a POSIXy environment for building MinGW-W64 (32bit and 64bit) applications. So one is not supposed to build software using the MSYS2-GCC if one is not developing MSYS2. If one needs an environment more close to Unix, the MSYS2-people suggest to use Cygwin.

I created pull-request #375 that enhances our build-system to automatically to create a pkg-config-file depending on the installation path. It needs some testing ;-)

Are you interested in working further on this to create an automated package that avoids copying files around? Like the libssh2 or doxygen-package I suggested above? Maybe, once a version with my PR merged is released and the package has good enough quality, you could even submit it to @Alexpux/MINGW-packages?

@Rondom
Copy link
Contributor

Rondom commented Oct 25, 2016

I guess the package mostly working with Msys2 as Mingw has no syslog while Linux probably use fuse directly but not dokan-fuse.

Can you please explain what you mean here in more detail? I do not really understand 😕

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.

None yet

3 participants