Ive tried to contribute but i am struggling to know the correct process.
I have forked and clone the repo, installed docker and got that working. My question is now how do I edit the files? within docker or local? what is the best way or the correct way?
Thanks
if you have docker set up, you still need to clone a repo inside the container to work on Packages. Here is how i've done it:
since you've mounted the spksrc folder of the docker container to your local drive you can edit files locally and use docker just for building/testing/compiling. but: make sure to clone the repo inside the spksrc container
Thanks @cytec, how do i build/test and compile? are they the make commands?
yup, see https://github.com/SynoCommunity/spksrc/wiki/Compile-and-build-rules for a list of commands and/or https://github.com/SynoCommunity/spksrc/wiki/Developers-HOW-TO as starting Point... Especially the Helpful Links Section ;)
Ive done as they the docs say so i have make arch-88f6281 and i get an error:
===> Building package for arch 88f6281
make[1]: Entering directory '/spksrc/spk/jackett'
/spksrc/spk/jackett/work-88f6281-5.2/tc_vars.mk:1: *** An error occured while setting up the toolchain, please check the messages above. Stop.
make[1]: Leaving directory '/spksrc/spk/jackett'
../../mk/spksrc.spk.mk:416: recipe for target 'arch-88f6281' failed
make: [arch-88f6281] Error 2 (ignored)
Am i missing something?
Do a make clean, it looks like your work dir needs cleaning. If not that, maybe it's a permissions issue with Docker not being able to access the spksrc directory?
make clean and then running make arch-88f6281 worked but now i get this error make[1]: warning: Clock skew detected. Your build may be incomplete.
Is this something i should be worried about? I assume yes and if so what should i be doing differently?
It happens in a VM/Docker due to the clock sync with the host, and it occurs when files have a modification time that is later than the current system time (only relevant when you use a file share outside of the VM/container)
For spksrc itself, it doesn't matter, but issues could occur when the compile process of dependencies relies on modification times. However, this should generally not be a problem as far as I know.
Ok great. When i compile should the cross/jackett/disgest file update at all?
No, not unless you tell it to. When compiling, spksrc checks the checksums vs the downloaded file. It'll tell you if the checksum isn't what it should be, and then you're expected to intervene. Either the download is corrupt, or you expected a change, and forgot to update digests with make digests.
Sorry for the dumb question so what is the right way order/process i need to do? I did read the docs but got abit confused sorry.
Is it
make digests within the directory of the package i.e. cross/jackettmake arch-88f6281 within the directory of the package i.e. spk/jackett or in the root directory?Is that everything or other steps required?
I happen to have one change staged that'll make it a slight bit easier, but here's the gist:
cross/jackett/Makefilemake clean && make download && make digests && make cleanspk/jackett, and run make arch-something, where something is the arch you want to build for.Awesome thanks! and as for testing? how do you test?
@cytec I wanted to automatically download when running make digests. Then we can do away with at least one command during cross package updates.
Install the package. Does it do what you want it to? That'd be it :P
But to be clear, it depends on the update of course. The more invasive the changes, the more we expect you to verify. Take a look at the PR template for example: https://github.com/SynoCommunity/spksrc/blob/master/.github/PULL_REQUEST_TEMPLATE.md
@GazzaHazza well... install it on you'r DS? ;)
Shouldn't break anythin as the SPK is pretty much done and you are just changing the share folder in this case. So i'd assume it's safe to "test" it on a DS rather than a VM
@Dr-Bean uh it doesn't do that already? i delete the digests file before updating and after a successfull compile run make clean && make digests can't remeber to have make download used more than maybe once and that was for toolchains i think... but yeah that would be nice
And one last thing: if you're updating versions and expect a new package release, that means that spk/jackett/Makefiles SPK_VERS and SPK_REV, as well as the CHANGELOG entry should be updated.
See the previous commit for Jackett: https://github.com/SynoCommunity/spksrc/commit/071a1d8a0fa3ce58006d581f3ea039050f89fbaf
This is going to sound really stupid but how would i install the packages i only install via the DSM package manager?
@cytec Deleting digests hasn't been necessary for a while now, I got sick of having to manually remove it every time ;)
But what make digests doesn't do yet is actually kick off a download if the downloaded file isn't locally available yet: it;ll just tell you the file isn't there, and stop with that.
@GazzaHazza There's a Manual install link in Package Center :)
@Dr-Bean do i just link to my local git repo? what would the URL be?
For opening a pull request, you mean? See https://github.com/SynoCommunity/spksrc/wiki/Developers-HOW-TO#contribute-to-spksrc.
You need to push your changes to your own fork of spksrc on Github, and you'll automatically get the question if you want to open a PR. Check the link at the bottom referring to Github's information on Git if you're not sure how it works.
Oh no sorry, for the manual install? I found the check for updates and worked like a charm :) but now i need to create this PR to help everyone else
Oh right. Well...link, it's a button called Manual Install, see the screenshot, first of three buttons at the top in Package Center.

OK then in the input box what file do i do?
Find the package file :P The package you created is located in /spksrc/packages, so should be easy enough to find.
Got it? If you're not sure of the path, just use the Browse button, right next to that box. Easier than trying to type a path you don't necessarily know.
No sorry, I dont have a packages folder within /spksrc.
Err...you have created the package, right? Did something like cd spksrc/spk/jackett, run a make arch-$(thearchyouwanttotestwith), and let it run to completion?
Yep.. followed all your steps in above comment and the output i got is...
===> Building package for arch 88f6281
make[1]: Entering directory '/spksrc/spk/jackett'
(cd /spksrc/spk/jackett/work-88f6281-5.2/staging && tar cpzf /spksrc/spk/jackett/work-88f6281-5.2/package.tgz --owner=root --group=root *)
===> Creating checksum for jackett
(cd /spksrc/spk/jackett/work-88f6281-5.2 && tar cpf /spksrc/spk/jackett/../../packages/jackett_88f6281-5.2_0.7.806-3.spk --group=root --owner=root package.tgz INFO PACKAGE_ICON.PNG PACKAGE_ICON_120.PNG scripts)
make[1]: Leaving directory '/spksrc/spk/jackett'
Ok i lie! sorry wasnt showing in my IDE but is in finder! Sorry!!
Ok manually installed and works a charm. So i will create PR in the next couple of days. Following the template do i just need to write what is updated? and why? and thats it as its only a version bump?
馃憤
Adding the changelog from upstream to the PR is nice (the CHANGELOG entry in the Makefile just has to say: Updated to version xyz). Make sure you follow the checklist in the PR template, and mark the entries complete, that's required. In this case, shouldn't be too interesting though.
That should be about it.
@Dr-Bean , sorry for late reply on this.. these is no CHANGELOG in the Makefile and not 100% sure what you mean by the upstream?
@GazzaHazza what @Dr-Bean said was: you don't have to include the full changelog of the original app... we provide only a "basic" changelog on what WE did change in the SPK so just add this to your makefile: CHANGELOG = Updated to version xyz see: https://github.com/SynoCommunity/spksrc/blob/master/spk/couchpotatoserver-custom/Makefile#L16
@cytec - cheers, i was trying to find a example but couldnt, so thanks!
With the PR merged, I guess this can be closed, right? @GazzaHazza Take a look at some of our other open issues, we have more work available if you want :P
Ha i will have a look and see what i can do!!