[Slackbuilds-users] Deal with source that requires submodules
Jeremy Hansen
jebrhansen+SBo at gmail.com
Fri Jul 29 02:28:54 UTC 2022
On Thu, Jul 28, 2022, 4:39 PM Christoph Willing <chris.willing at linux.com>
wrote:
> On 29/7/22 04:11, Heinz Wiesinger wrote:
> > On Thursday, 28 July 2022 20:08:02 CEST Wen-Wei Kao wrote:
> >> Hello,
> >>
> >> Recently while writing SlackBuilds, there is a particular package
> (https://
> >> github.com/fcitx/libime) that requires a submodule pulled in before
> >> compiling, but the Github release tags' sources don't have it included.
> >> What are the recommended ways to deal with this? Should I mark both as
> >> assets in the .info file, and decompress them in appropriate places?
> TIA.
> >
> > There's a second source tarball :)
> >
> > https://download.fcitx-im.org/fcitx5/libime/libime-1.0.13_dict.tar.xz
> >
> > Notice the "_dict" at the end. That one shouldn't need any external
> additions.
> >
>
> Although there's an easy solution in this particular case, I would be
> interested in hearing of a more general solution for cases where there
> is no such additional tarball available.
>
> I maintain another SlackBuild which has exactly the same problem. My
> solution so far has been to locally checkout the commit which
> corresponds to the (incomplete) release tarball. Then I pull in the
> required submodules and generate a new (complete) tarball which I host
> at slackbuildsdirectlinks, from where can be used as a single download
> for the SlackBuild.
>
> While that's a workable solution, I would definitely be interested in
> alternatives.
>
> chris
In the few SlackBuilds I've had that used git submodules, I'll just view
the .gitmodules file and use some bash to extract the modules' repos and
see where the extracted source belongs. That .gitmodules file will let you
know if it is based on the master branch or a specific tag/version/commit.
If it's the master branch, then I'll go through and find the commit ID I
want to download and add it to the PRGNAM.info download section. If it's a
specific version, I'll sometimes use bash to generate my download links,
other times, I'll just manually do it (it depends on how many downloads
there end up being).
Sometimes you'll luck out and all the submodules belong in the same folder
as their own subfolder. In that case, you can simply extract all the
submodules to the same directory with a wildcard, otherwise you need to
manually add specific lines in the SlackBuild for each.
One of mine, redeclipse, has 38 submodules, so I actually created a
separate submodule file that the SlackBuild references to know what
tarballs to extract. Since the versions aren't used in the folder name when
properly placed, I don't worry about what the files are called and just use
a wildcard for the version.
Unfortunately, it seems I was dumb and just had all the generated
information done by a piped together command that I didn't save.
Apparently, I'm a glutton for punishment when it needs to be updated.
https://slackbuilds.org/repository/15.0/games/redeclipse/
https://slackbuilds.org/repository/14.2/games/glPortal/ (haven't had time
to get this to work on 15.0 yet)
In the case of the OP's situation, they could just add
https://github.com/kpu/kenlm/archive/bcd4af6/kenlm-bcd4af619a2fa45f5876d8855f7876cc09f663af.tar.gz
to the DOWNLOAD in the .info with its corresponding MD5SUM and then add
something like the following into the SlackBuild:
KENVER=${KENVER:-bcd4af619a2fa45f5876d8855f7876cc09f663af}
(extract main source)
rm -r src/libime/core/kenlm
tar xvf $CWD/kenlm-$KENVER.tar.gz
mv kenlm-$KENVER src/libime/core/kenlm
And then continue the build.
Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20220728/aaf26218/attachment.htm>
More information about the SlackBuilds-users
mailing list