144 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			144 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!doctype html>
 | 
						|
<html lang="en">
 | 
						|
<head>
 | 
						|
	<meta charset="utf-8">
 | 
						|
	<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
						|
	<meta name="color-scheme" content="dark light">
 | 
						|
	<link rel="icon" href="data:,">
 | 
						|
	<title>Running `barf` on MacOS</title>
 | 
						|
	<link href="https://barf.bt.ht/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
 | 
						|
	<style>
 | 
						|
		* {
 | 
						|
			box-sizing: border-box;
 | 
						|
		}
 | 
						|
		body {
 | 
						|
			font-family: sans-serif;
 | 
						|
			line-height: 1.45;
 | 
						|
			margin: 0 auto;
 | 
						|
			max-width: 45rem;
 | 
						|
			padding: 0 15px;
 | 
						|
		}
 | 
						|
		hr {
 | 
						|
			background-color: grey;
 | 
						|
			border: 0;
 | 
						|
			height: 1px;
 | 
						|
			margin: 2rem 0;
 | 
						|
		}
 | 
						|
		nav {
 | 
						|
			margin: 2rem 0 0;
 | 
						|
		}
 | 
						|
		main {
 | 
						|
			hyphens: auto;
 | 
						|
		}
 | 
						|
		main p {
 | 
						|
			margin: 1rem;
 | 
						|
		}
 | 
						|
		h1,h2,h3,h4 {
 | 
						|
			margin: 2rem 0 0;
 | 
						|
		}
 | 
						|
		h1 {
 | 
						|
			margin-bottom: 0.5rem;
 | 
						|
		}
 | 
						|
		h1 + p {
 | 
						|
			margin: 0 0 1rem;
 | 
						|
		}
 | 
						|
		span.created {
 | 
						|
			display: block;
 | 
						|
			margin: 4px 15px;
 | 
						|
		}
 | 
						|
		img {
 | 
						|
			border: 1px solid lightgrey;
 | 
						|
			height: auto;
 | 
						|
			max-width: 100%;
 | 
						|
			width: auto;
 | 
						|
		}
 | 
						|
		blockquote {
 | 
						|
			border: 1px solid;
 | 
						|
			border-left: 6px solid;
 | 
						|
			margin: 2rem 0;
 | 
						|
			padding: 10px;
 | 
						|
		}
 | 
						|
		blockquote p {
 | 
						|
			margin: 0;
 | 
						|
		}
 | 
						|
		figure {
 | 
						|
			margin: 2rem 0;
 | 
						|
		}
 | 
						|
		figcaption {
 | 
						|
			color: slategrey;
 | 
						|
		}
 | 
						|
		code {
 | 
						|
			border: 1px solid;
 | 
						|
			padding: 0.1rem 0.3rem;
 | 
						|
			tab-size: 4;
 | 
						|
		}
 | 
						|
		pre {
 | 
						|
			border: 1px solid;
 | 
						|
		}
 | 
						|
		pre code {
 | 
						|
			border: 0;
 | 
						|
			display: block;
 | 
						|
			overflow-x: auto;
 | 
						|
			padding: 0.3rem 0.6rem;
 | 
						|
		}
 | 
						|
		table {
 | 
						|
			border-collapse: collapse;
 | 
						|
			margin: 2rem 0;
 | 
						|
			text-align: left;
 | 
						|
			width: 100%;
 | 
						|
		}
 | 
						|
		tr {
 | 
						|
			border-bottom: 1px solid lightgrey;
 | 
						|
		}
 | 
						|
		tr:nth-of-type(odd) td {
 | 
						|
			background-color: #f8f8f8;
 | 
						|
		}
 | 
						|
		th,td {
 | 
						|
			padding: 6px;
 | 
						|
		}
 | 
						|
		footer {
 | 
						|
			border-top: 1px dashed grey;
 | 
						|
			margin: 2rem 0;
 | 
						|
			padding: 1rem 15px;
 | 
						|
		}
 | 
						|
		@supports (color-scheme: dark light) {
 | 
						|
			@media screen and (prefers-color-scheme: dark) {
 | 
						|
				a:link {color: #9e9eff;}
 | 
						|
				a:visited {color: #d0adf0;}
 | 
						|
				a:active {color: red;}
 | 
						|
			}
 | 
						|
		}
 | 
						|
	</style>
 | 
						|
</head>
 | 
						|
 | 
						|
<nav>
 | 
						|
	<a href="/">Home</a><span> | </span><a href="/about">About</a><span> | </span><a href="/websites">Websites</a><span> | </span><a href="https://git.sr.ht/~bt/barf">Source Code</a>
 | 
						|
</nav>
 | 
						|
 | 
						|
<main>
 | 
						|
<h1>Running <code>barf</code> on MacOS</h1>
 | 
						|
<p>2023-01-18</p>
 | 
						|
<p>The <code>barf</code> project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.</p>
 | 
						|
<p>There are some very minor changes you'll need to make in the main <code>barf</code> script if you plan to run it on MacOS.</p>
 | 
						|
<h2>Download Packages</h2>
 | 
						|
<p>This walkthrough assumes that you already have <a href="https://brew.sh/">homebrew</a> installed on your machine.</p>
 | 
						|
<p>You will need to install the GNU versions of both <code>date</code> and <code>sed</code> in order to avoid breaking things when <code>barf</code> tries to build.</p>
 | 
						|
<pre><code>brew install coreutils
 | 
						|
brew install gnu-sed
 | 
						|
</code></pre>
 | 
						|
<h2>The Script Tweaks</h2>
 | 
						|
<p>Now open the main <code>barf</code> file in your project and replace all instances of <code>sed</code> with <code>gsed</code>.</p>
 | 
						|
<p>Then change the following variable:</p>
 | 
						|
<pre><code>published_date=$(date -d $basic_date +%FT%TZ)
 | 
						|
</code></pre>
 | 
						|
<p>to this:</p>
 | 
						|
<pre><code>published_date=$(gdate -d $basic_date +%FT%TZ)
 | 
						|
</code></pre>
 | 
						|
<p>After that everything should work perfectly fine. There is probably a cleaner way to do this, but I like to keep things simple.</p>
 | 
						|
<footer role="contentinfo">
 | 
						|
    <span><a href="#">↑ Back to Top</a></span><br><br>
 | 
						|
    <small>
 | 
						|
        Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br>
 | 
						|
        The <a href="https://git.sr.ht/~bt/barf">code for this site</a> is <a href="https://git.sr.ht/~bt/barf/tree/master/item/LICENSE">MIT</a>.
 | 
						|
    </small>
 | 
						|
</footer> |