Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# FIXME: quick hardcoding of GOARM for raspbian; replace with a holistic
# refactoring of how we handle target architecture
distribution := $(shell . /etc/os-release; echo "$${ID}")
ifeq ($(distribution),raspbian)
Comment on lines +19 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the "Debian native" way to write this would've been including /usr/share/dpkg/vendor.mk (or /usr/share/dpkg/default.mk which brings in even more useul variables) and checking whether DEB_VENDOR is Raspbian 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that sounds nice. Do you have an example what that looks like? (For me to "code by numbers")? So those files don't go into the debian/ directory, but elsewhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They'd go here -- Tianon just means using a makefile include.

Good to know; I cribbed this from other examples of rules that didn't make light of that file 🙈

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sorry; more concretely, something like:

Suggested change
distribution := $(shell . /etc/os-release; echo "$${ID}")
ifeq ($(distribution),raspbian)
include /usr/share/dpkg/vendor.mk
ifeq ($(DEB_VENDOR),Raspbian)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(but as it's temporary, I don't think it really matters all that much)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! ❤️❤️

For sure! Current patch does the job, so I'm ok with it for now. But it's good to learn how to do these things correctly; there's a risk in having "the wrong way" present as it's all too easy to (as one does) taking the "wrong way" as an example and such things starting to spread around.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the "wrong way" from some of the best maintained packages in Debian, so you're definitely right 😂

In any case, I think I will have a proposal next week for simplifying this whole mess and putting it semi-permanently out of mind.

export GOARM=6
endif


%:
dh $@ --with systemd

Expand Down