You are not logged in.

#1 2020-07-02 17:54:37

Xwang
Member
Registered: 2012-05-14
Posts: 353

Creating a new PKGBUILD for hopsan

Hi,
I'm trying to create a PKGBUILD for hopsan (https://github.com/Hopsan/hopsan).
I've followed the instruction and it compiles, but I have some doubts on how to arrange things in the PKGBUILD
1) during the build proces is necessary to source a file and execute some scripts which are inside a src subfolder. Can I source and execute scripts in the prepare function?
2) the make process creates .o files in the build directory and puts executables and libraries in the same bin directory.  How should I copy them to the pkg folder in the install function of the PKGBUILD?
3) in this case it seems that there is no make install available. Is it a problem?


I'm still learning English so please excuse me if my English is not good enough and feel free to correct me via PM if you want.

Offline

#2 2020-07-02 21:13:11

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Creating a new PKGBUILD for hopsan

1) which script needs to be sourced for this? I don't see one in the repo. No, you cannot source something in prepare() and use it in build -- it will break if you use makepkg --nobuild && makepkg --noextract.

2) by specifying each file manually, and copying it over. e.g. use install -Dm755 ./foo "$pkgdir"/usr/bin/foo

3) It's a problem in the sense that if there was one, #2 would not be a problem. Because install targets are useful for a reason. I advise you to make your life easier by opening an issue and asking for one. big_smile


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2020-07-03 13:39:22

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,964

Re: Creating a new PKGBUILD for hopsan

I think you did see https://github.com/Hopsan/hopsan/blob/m … uctions.md , but did you read the whole document ?

The first thing on that page I noticed is that hopsan uses git submodules .
Git submodules require special handling in makepkg, see https://wiki.archlinux.org/index.php/VC … submodules


1)

pushd dependencies
source ./setHopsanBuildPaths.sh

The script is at https://github.com/Hopsan/hopsan/blob/m … ldPaths.sh .
All it does is set some variables, that functionality can easily be replicated in build() without sourcing / running the script.

Also some scripts are mentioned that get 3rd party dependencies . Those scripts should be looked at to figure out if there are archlinux packages for these dependencies.

The first one , fmi library appears to be present in the AUR.

2) and 3)
hopsan uses qmake which does things differently.
Instead of an install target the makefile produced by qmake uses INSTALL_ROOT [1] .


[1] https://wiki.archlinux.org/index.php/Ma … d_packages

Last edited by Lone_Wolf (2020-07-03 13:40:31)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB